/*
 * Contentosapp Studio Admin — Dashboard styles.
 * Extracted from costudio-admin.css for page-specific loading.
 */

/* ══════════════════════════════════════════════════════════════════════════
   DASHBOARD — Focused layout (v3)
   Prefix: .fos-dash-*   Variables: --fos-* only
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 1 — Header CTA (Dashboard) ─────────────────────────────────────────────── */

.fos-dash-header-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--fos-primary);
    color: #fff;
    border-radius: var(--fos-radius-sm);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--fos-transition);
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(108, 71, 255, 0.25);
}

.fos-dash-header-cta:hover {
    background: var(--fos-primary-dark);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(108, 71, 255, 0.35);
}

.fos-dash-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--fos-transition);
    white-space: nowrap;
}

.fos-dash-notice--warn {
    background: var(--fos-warning-light);
    color: #78350F;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.fos-dash-notice--warn:hover {
    background: #FDE68A;
    border-color: rgba(245, 158, 11, 0.45);
    color: #78350F;
    text-decoration: none;
}

.fos-dash-notice__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #F59E0B;
}

.fos-dash-notice__action {
    font-weight: 600;
    margin-left: 2px;
}

/* ── 3 — Main Grid ─────────────────────────────────────────────────────────── */

.fos-dash-main-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 16px;
}

.fos-dash-card {
    background: #fff;
    border: 1px solid var(--fos-border);
    border-radius: var(--fos-radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.03);
}

.fos-dash-card-header {
    padding: 13px 18px;
    border-bottom: 1px solid var(--fos-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--fos-bg-soft);
}

.fos-dash-card-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fos-dash-card-header-icon {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: var(--fos-primary-faint);
    border: 1px solid var(--fos-primary-border);
    display: grid;
    place-items: center;
    font-size: 10px;
    flex-shrink: 0;
}

.fos-dash-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fos-text);
}

.fos-dash-card-link {
    font-size: 11px;
    font-weight: 500;
    color: var(--fos-primary);
    text-decoration: none;
}

.fos-dash-card-link:hover {
    text-decoration: underline;
}

/* ── Ideas (queue) ─────────────────────────────────────────────────────────── */

.fos-dash-ideas {
    display: flex;
    flex-direction: column;
}

.fos-dash-idea {
    padding: 12px 16px;
    border-bottom: 1px solid var(--fos-border);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: var(--fos-transition);
}

.fos-dash-idea:last-child {
    border-bottom: none;
}

.fos-dash-idea:hover {
    background: var(--fos-bg-soft);
}

.fos-dash-idea-priority {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.fos-dash-idea-priority--high {
    background: var(--fos-danger);
}

.fos-dash-idea-priority--medium {
    background: var(--fos-warning);
}

.fos-dash-idea-priority--low {
    background: var(--fos-text-dim);
}

.fos-dash-idea-body {
    flex: 1;
    min-width: 0;
}

.fos-dash-idea-keyword {
    font-size: 12px;
    font-weight: 600;
    color: var(--fos-text);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fos-dash-idea-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fos-dash-idea-site {
    font-size: 10px;
    color: var(--fos-text-dim);
}

.fos-dash-idea-type {
    font-size: 9px;
    font-weight: 600;
    color: var(--fos-text-dim);
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--fos-bg-soft);
    border: 1px solid var(--fos-border);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.fos-dash-idea-launch {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--fos-border);
    background: #fff;
    display: grid;
    place-items: center;
    font-size: 11px;
    color: var(--fos-text-dim);
    text-decoration: none;
    transition: var(--fos-transition);
    flex-shrink: 0;
    opacity: 0;
}

.fos-dash-idea:hover .fos-dash-idea-launch {
    opacity: 1;
    color: var(--fos-primary);
    border-color: var(--fos-primary-border);
    background: var(--fos-primary-faint);
}

/* ── Queue empty state ─────────────────────────────────────────────────────── */

.fos-dash-queue-empty {
    padding: 20px 18px;
}

.fos-dash-queue-empty-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fos-text-sub);
    margin-bottom: 4px;
}

.fos-dash-queue-empty-desc {
    font-size: 11px;
    color: var(--fos-text-dim);
    margin-bottom: 14px;
    line-height: 1.5;
}

.fos-dash-queue-input-row {
    display: flex;
    gap: 6px;
}

.fos-dash-queue-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--fos-border-input);
    border-radius: var(--fos-radius-sm);
    background: var(--fos-bg-soft);
    font-size: 12px;
    color: var(--fos-text);
    font-family: inherit;
    outline: none;
    transition: var(--fos-transition);
}

.fos-dash-queue-input::placeholder {
    color: var(--fos-text-dim);
}

/* M12: Focus ring token centralizado */
.fos-dash-queue-input:focus {
    border-color: var(--fos-primary);
    background: #fff;
    box-shadow: var(--fos-focus-ring);
}

.fos-dash-queue-btn {
    padding: 8px 14px;
    border-radius: var(--fos-radius-sm);
    background: var(--fos-primary);
    color: #fff;
    border: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: var(--fos-transition);
    white-space: nowrap;
}

.fos-dash-queue-btn:hover {
    background: var(--fos-primary-dark);
}

/* ── Recent articles ───────────────────────────────────────────────────────── */

.fos-dash-articles {
    display: flex;
    flex-direction: column;
}

.fos-dash-article {
    padding: 13px 18px;
    border-bottom: 1px solid var(--fos-border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: var(--fos-transition);
}

.fos-dash-article:last-child {
    border-bottom: none;
}

.fos-dash-article:hover {
    background: var(--fos-bg-soft);
}

.fos-dash-article-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--fos-text-dim);
    width: 18px;
    flex-shrink: 0;
    padding-top: 1px;
}

.fos-dash-article-body {
    flex: 1;
    min-width: 0;
}

.fos-dash-article-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fos-text);
    letter-spacing: -0.2px;
    margin-bottom: 5px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fos-dash-article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.fos-dash-article-site {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--fos-primary-faint);
    color: var(--fos-primary);
    border: 1px solid var(--fos-primary-border);
}

.fos-dash-article-date {
    font-size: 11px;
    color: var(--fos-text-dim);
}

.fos-dash-article-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.12s;
}

.fos-dash-article:hover .fos-dash-article-actions {
    opacity: 1;
}

.fos-dash-action-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--fos-border);
    background: #fff;
    display: grid;
    place-items: center;
    font-size: 11px;
    color: var(--fos-text-sub);
    text-decoration: none;
    transition: var(--fos-transition);
    cursor: pointer;
}

.fos-dash-action-btn:hover {
    border-color: var(--fos-primary-border);
    color: var(--fos-primary);
    background: var(--fos-primary-faint);
    text-decoration: none;
}

/* ── M9: Articles empty state — melhorado com título, CTA contextual ─────── */

.fos-dash-articles-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--fos-text-dim);
}

.fos-dash-articles-empty__icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.8;
    display: block;
}

.fos-dash-articles-empty__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fos-text-sub);
    margin: 0 0 6px;
}

.fos-dash-articles-empty p {
    font-size: 12px;
    margin: 0 0 16px;
    line-height: 1.5;
}

.fos-dash-articles-empty__cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: var(--fos-radius-sm);
    background: var(--fos-primary-faint);
    color: var(--fos-primary);
    border: 1px solid var(--fos-primary-border);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--fos-transition);
}

.fos-dash-articles-empty__cta:hover {
    background: var(--fos-primary);
    color: #fff;
    border-color: var(--fos-primary);
    text-decoration: none;
}

/* ── M11: Focus visible nos chips de seleção (acessibilidade) ───────────── */

.fos-chip-cb:focus-visible+.fos-chip {
    outline: 2px solid var(--fos-primary);
    outline-offset: 2px;
    box-shadow: var(--fos-focus-ring);
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media screen and (max-width: 1100px) {
    .fos-dash-main-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 900px) {
    .fos-kpi-grid--dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .fos-dash-central-toolbar {
        flex-wrap: wrap;
    }
}

@media screen and (max-width: 782px) {
    .fos-kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Period Filter Pills ───────────────────────────────────────────────────── */

.fos-dash-period {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    flex-wrap: wrap;
}

.fos-dash-period__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--fos-text-sub, #6b7280);
    margin-right: 4px;
}

.fos-dash-period__pill {
    appearance: none;
    background: #fff;
    border: 1px solid var(--fos-border, #e5e7eb);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--fos-text, #111827);
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
}

.fos-dash-period__pill:hover {
    border-color: var(--fos-primary, #6c47ff);
    color: var(--fos-primary, #6c47ff);
}

.fos-dash-period__pill.is-active {
    background: var(--fos-primary, #6c47ff);
    border-color: var(--fos-primary, #6c47ff);
    color: #fff;
}

.fos-dash-period__pill:focus-visible {
    outline: 2px solid var(--fos-primary, #6c47ff);
    outline-offset: 2px;
}

/* ── Recently Published — Card Header ─────────────────────────────────────── */

.fos-dash-recent-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--fos-bg-soft, #f8fafc);
    border-bottom: 1px solid var(--fos-border, #e5e7eb);
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

.fos-dash-recent-header__filters {
    margin: auto;
    display: flex;
    align-items: center;
}

.fos-dash-recent-header__title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.fos-dash-recent-header__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--fos-primary-light, #f3f0ff);
    font-size: 14px;
    line-height: 1;
    flex: 0 0 auto;
}

.fos-dash-recent-header__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--fos-text, #111827);
    letter-spacing: -0.01em;
}

.fos-dash-recent-header__link {
    font-size: 13px;
    font-weight: 500;
    color: var(--fos-primary, #6c47ff);
    text-decoration: none;
    white-space: nowrap;
    flex: 0 0 auto;
}

.fos-dash-recent-header__link:hover,
.fos-dash-recent-header__link:focus {
    text-decoration: underline;
    color: var(--fos-primary, #6c47ff);
}

/* ── Recently Published Table ──────────────────────────────────────────────── */

.fos-dash-recent-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.fos-dash-recent-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fos-text-sub, #6b7280);
    padding: 10px 12px;
    border-bottom: 1px solid var(--fos-border, #e5e7eb);
    background: transparent;
}

.fos-dash-recent-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--fos-border-soft, #f1f5f9);
    vertical-align: middle;
    color: var(--fos-text, #111827);
}

.fos-dash-recent-table tbody tr:last-child td {
    border-bottom: none;
}

.fos-dash-recent-table tbody tr:hover {
    background: var(--fos-bg-soft, #f9fafb);
}

.fos-dash-recent-table__col-title {
    width: auto;
}

.fos-dash-recent-table__col-site {
    width: 110px;
}

.fos-dash-recent-table__col-priority {
    width: 90px;
}

.fos-dash-recent-table__col-date {
    width: 100px;
}

.fos-dash-recent-table__col-status {
    width: 110px;
}

.fos-dash-recent-table__title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fos-dash-recent-table__link {
    color: var(--fos-text, #111827);
    text-decoration: none;
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fos-dash-recent-table__link:hover {
    color: var(--fos-primary, #6c47ff);
    text-decoration: underline;
}

.fos-dash-recent-table__site {
    color: var(--fos-text-sub, #6b7280);
}

.fos-dash-recent-table__date {
    color: var(--fos-text-sub, #6b7280);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.fos-dash-recent-table__muted {
    color: var(--fos-text-dim, #9ca3af);
}

.fos-dash-recent-loading {
    padding: 24px 12px;
    text-align: center;
}

/* ── Shared pill / badge primitives (also defined in hub.css) ─────────────── */

.fos-priority-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    white-space: nowrap;
}

.fos-priority-badge--high {
    background: #fef2f2;
    color: #b91c1c;
}

.fos-priority-badge--medium {
    background: var(--fos-primary-light, #f3f0ff);
    color: var(--fos-primary, #6c47ff);
}

.fos-priority-badge--low {
    background: #f8f8f9;
    color: var(--fos-text-dim, #6b7280);
}

.fos-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1.4;
}

.fos-status-pill--published {
    background: #e6faf4;
    color: #065f46;
}

.fos-status-pill--draft {
    background: #f8f8f9;
    color: var(--fos-text-sub);
    border: 1px solid var(--fos-border);
}

.fos-status-pill--cancelled {
    background: #F1F5F9;
    color: #64748B;
}

.fos-status-pill--completed {
    background: #f0fdf4;
    color: #166534;
}

.fos-status-pill--running {
    background: #eff6ff;
    color: #1d4ed8;
}

.fos-status-pill--running::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    animation: fos-pulse-dot 1.4s ease-in-out infinite;
}

.fos-status-pill--pending {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid var(--fos-border, #e5e7eb);
}

.fos-status-pill--paused {
    background: #fffbeb;
    color: #b45309;
}

.fos-status-pill--error {
    background: #fef2f2;
    color: #b91c1c;
}

.fos-status-pill--planned {
    background: #fefce8;
    color: #854d0e;
}

@keyframes fos-pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.25;
    }
}

/* ── Recent Articles — Status Filter Pills ───────────────────────────────── */

.fos-dash-recent-filters {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding: 0;
}

.fos-dash-recent-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    color: var(--fos-text-sub, #6b7280);
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.fos-dash-recent-filter-pill:hover {
    background: var(--fos-primary-faint, rgba(108, 71, 255, 0.05));
    color: var(--fos-primary, #6c47ff);
}

.fos-dash-recent-filter-pill.is-active {
    background: var(--fos-primary-light, #f3f0ff);
    color: var(--fos-primary, #6c47ff);
    border-color: rgba(108, 71, 255, 0.2);
}

.fos-dash-recent-filter-pill__count {
    opacity: 0.55;
    font-weight: 400;
}

.fos-dash-recent-empty {
    text-align: center;
    padding: 24px 12px !important;
    color: var(--fos-text-sub, #6b7280);
    font-size: 13px;
}

/* ── Sync Button ─────────────────────────────────────────────────────────── */

.fos-dash-sync-btn {
    appearance: none;
    background: none;
    border: none;
    padding: 2px;
    margin-left: 6px;
    cursor: pointer;
    color: var(--fos-text-dim);
    transition: var(--fos-transition);
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    border-radius: 4px;
}

.fos-dash-sync-btn:hover {
    color: var(--fos-primary);
    background: var(--fos-primary-faint);
}

.fos-dash-sync-btn.is-spinning {
    animation: fos-spin 0.8s linear infinite;
}

@keyframes fos-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}