:root {
    --background: #f4f6fa;
    --surface: #ffffff;
    --surface-soft: #f8faff;
    --text: #10182f;
    --text-soft: #697791;
    --border: #e1e6f0;
    --primary: #315cf4;
    --purple: #7437f5;
    --success: #087d5c;
    --warning: #b46a00;
    --danger: #c83232;
    --sidebar: #111a32;
    --shadow: 0 18px 50px rgba(22, 35, 74, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

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

[hidden] {
    display: none !important;
}

.dashboard-loading,
.dashboard-error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(82, 93, 240, 0.1),
            transparent 34%
        ),
        var(--background);
}

.loading-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 34px;
    font-size: 30px;
    font-weight: 850;
}

.loading-brand strong span,
.sidebar-brand strong span {
    color: var(--primary);
}

.brand-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--purple)
    );
    color: white;
    font-size: 22px;
    font-weight: 900;
}

.loading-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid #dce2f2;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 750ms linear infinite;
}

.dashboard-loading p {
    margin-top: 20px;
    color: var(--text-soft);
}

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

.dashboard-error-page {
    padding: 30px;
}

.error-card {
    width: min(100%, 550px);
    padding: 48px;
    border: 1px solid var(--border);
    border-radius: 27px;
    background: white;
    box-shadow: var(--shadow);
    text-align: center;
}

.error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #fff0f0;
    color: var(--danger);
    font-size: 28px;
    font-weight: 900;
}

.error-card h1 {
    margin: 23px 0 13px;
}

.error-card p {
    color: var(--text-soft);
    line-height: 1.65;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.primary-button,
.secondary-button {
    min-height: 46px;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 750;
    cursor: pointer;
}

.primary-button {
    border: 0;
    background: linear-gradient(
        100deg,
        var(--primary),
        var(--purple)
    );
    color: white;
}

.secondary-button {
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
}

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: 275px;
    display: flex;
    flex-direction: column;
    padding: 28px 20px 23px;
    background: var(--sidebar);
    color: white;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px;
    font-size: 25px;
    font-weight: 850;
}

.sidebar-brand .brand-symbol {
    width: 43px;
    height: 43px;
}

.sidebar-navigation {
    display: grid;
    gap: 6px;
    margin-top: 46px;
}

.navigation-item {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 49px;
    padding: 0 13px;
    border-radius: 12px;
    color: #afbad2;
    font-size: 14px;
    font-weight: 680;
    transition:
        background 150ms ease,
        color 150ms ease;
}

.navigation-item:hover,
.navigation-item.active {
    background: rgba(255, 255, 255, 0.09);
    color: white;
}

.navigation-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    color: #d7deef;
    font-size: 10px;
    font-weight: 900;
}

.navigation-badge {
    margin-left: auto;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(117, 78, 255, 0.2);
    color: #c6b9ff;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-company {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 7px 19px;
}

.company-avatar,
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 11px;
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--purple)
    );
    color: white;
    font-weight: 850;
}

.company-avatar {
    width: 39px;
    height: 39px;
}

.sidebar-company div {
    min-width: 0;
}

.sidebar-company strong,
.sidebar-company span {
    display: block;
}

.sidebar-company strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.sidebar-company div > span {
    margin-top: 4px;
    color: #8997b3;
    font-size: 11px;
}

.sidebar-logout {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: transparent;
    color: #c0cadf;
    cursor: pointer;
}

.dashboard-main {
    min-height: 100vh;
    margin-left: 275px;
}

.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
}

.header-company-context span,
.header-company-context strong {
    display: block;
}

.header-company-context span {
    color: var(--text-soft);
    font-size: 11px;
}

.header-company-context strong {
    margin-top: 3px;
    font-size: 15px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 22px;
}

.header-credit {
    padding-right: 22px;
    border-right: 1px solid var(--border);
    text-align: right;
}

.header-credit span,
.header-credit strong {
    display: block;
}

.header-credit span {
    color: var(--text-soft);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.header-credit strong {
    margin-top: 3px;
    color: var(--primary);
}

.user-menu-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.user-avatar {
    width: 39px;
    height: 39px;
}

.user-description strong,
.user-description small {
    display: block;
}

.user-description strong {
    font-size: 13px;
}

.user-description small {
    max-width: 190px;
    overflow: hidden;
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-menu-button {
    display: none;
}

.dashboard-content {
    width: min(100%, 1500px);
    margin: 0 auto;
    padding: 38px 35px 80px;
}

.dashboard-section {
    scroll-margin-top: 100px;
    margin-bottom: 70px;
}

.welcome-block,
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 30px;
}

.section-eyebrow,
.card-eyebrow {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    font-weight: 850;
}

.welcome-block h1 {
    max-width: 760px;
    margin: 9px 0 0;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.welcome-block p,
.section-heading p {
    margin: 13px 0 0;
    color: var(--text-soft);
    line-height: 1.65;
}

.primary-action-link {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    min-height: 52px;
    padding: 0 21px;
    border-radius: 13px;
    background: linear-gradient(
        100deg,
        var(--primary),
        var(--purple)
    );
    color: white;
    font-size: 14px;
    font-weight: 780;
    box-shadow: 0 13px 27px rgba(68, 79, 239, 0.2);
}

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

.metric-card,
.dashboard-card,
.specialist-card {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-card {
    min-height: 187px;
    padding: 23px;
    border-radius: 19px;
}

.metric-card-heading {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
}

.metric-icon,
.specialist-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 11px;
    background: #eef2ff;
    color: var(--primary);
    font-size: 10px;
    font-weight: 900;
}

.metric-icon {
    width: 37px;
    height: 37px;
}

.metric-value {
    display: block;
    margin-top: 24px;
    font-size: 32px;
    line-height: 1;
    letter-spacing: -0.035em;
}

.metric-card p {
    margin: 12px 0 0;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.55;
}

.dashboard-primary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(330px, 0.7fr);
    gap: 20px;
    margin-top: 20px;
}

.dashboard-card {
    padding: 28px;
    border-radius: 21px;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.card-header h2,
.section-heading h2 {
    margin: 7px 0 0;
    font-size: 24px;
    letter-spacing: -0.025em;
}

.ai-badge,
.status-badge,
.count-badge,
.specialist-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
}

.ai-badge {
    width: 38px;
    height: 29px;
    background: linear-gradient(
        100deg,
        var(--primary),
        var(--purple)
    );
    color: white;
    font-size: 10px;
}

.intelligent-summary > p {
    margin: 25px 0 0;
    color: #34425f;
    font-size: 15px;
    line-height: 1.8;
}

.company-alert-list {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.company-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 12px;
    background: #fff8ea;
    color: #81520c;
    font-size: 12px;
    line-height: 1.55;
}

.company-alert::before {
    content: "!";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f2b84b;
    color: white;
    font-size: 11px;
    font-weight: 900;
}

.status-badge {
    min-height: 28px;
    padding: 0 10px;
    background: #ebfff8;
    color: var(--success);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.status-badge.inactive {
    background: #fff1f1;
    color: var(--danger);
}

.subscription-price {
    margin-top: 24px;
}

.subscription-price strong {
    font-size: 34px;
    letter-spacing: -0.04em;
}

.subscription-price span {
    margin-left: 3px;
    color: var(--text-soft);
}

.specialist-access-list {
    display: grid;
    gap: 8px;
    margin-top: 22px;
}

.specialist-access {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #3f4d67;
    font-size: 12px;
    font-weight: 680;
}

.specialist-access::before {
    content: "✓";
    color: var(--success);
    font-weight: 900;
}

.subscription-renewal {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 24px;
    padding-top: 17px;
    border-top: 1px solid var(--border);
    font-size: 11px;
}

.subscription-renewal span {
    color: var(--text-soft);
}

.specialists-section {
    margin-top: 54px;
}

.specialists-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 22px;
}

.specialist-card {
    padding: 25px;
    border-radius: 20px;
}

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

.specialist-symbol {
    width: 46px;
    height: 46px;
}

.specialist-symbol.legal {
    background: #f3edff;
    color: var(--purple);
}

.specialist-status {
    min-height: 26px;
    padding: 0 10px;
    background: #ebfff8;
    color: var(--success);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.specialist-status.blocked {
    background: #f1f3f7;
    color: #7b879e;
}

.specialist-card h3 {
    margin: 22px 0 0;
    font-size: 20px;
}

.specialist-card p {
    min-height: 48px;
    margin: 11px 0 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.65;
}

.specialist-card a,
.specialist-card button {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    margin-top: 23px;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 800;
    cursor: pointer;
}

.specialist-card button:disabled {
    color: #9ba6b9;
    cursor: default;
}

.section-heading {
    align-items: flex-start;
}

.count-badge {
    min-height: 31px;
    padding: 0 12px;
    background: #eef2ff;
    color: var(--primary);
    font-size: 10px;
}

.action-plan-list,
.history-list {
    display: grid;
    gap: 12px;
    margin-top: 25px;
}

.action-item,
.history-item {
    display: grid;
    align-items: center;
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: white;
}

.action-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.action-priority {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    border-radius: 13px;
    background: #fff1f1;
    color: var(--danger);
    font-size: 10px;
    font-weight: 900;
}

.action-priority.media {
    background: #fff8e8;
    color: var(--warning);
}

.action-priority.baixa {
    background: #ebfff8;
    color: var(--success);
}

.action-content h3,
.history-content h3 {
    margin: 0;
    font-size: 15px;
}

.action-content p,
.history-content p {
    margin: 7px 0 0;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.55;
}

.action-meta {
    text-align: right;
}

.action-meta strong,
.action-meta span {
    display: block;
}

.action-meta strong {
    font-size: 11px;
}

.action-meta span {
    margin-top: 5px;
    color: var(--text-soft);
    font-size: 10px;
}

.history-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.history-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    border-radius: 13px;
    background: #eef2ff;
    color: var(--primary);
    font-size: 10px;
    font-weight: 900;
}

.history-date {
    color: var(--text-soft);
    font-size: 11px;
}

.empty-state {
    padding: 38px;
    border: 1px dashed #ccd4e3;
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.52);
    text-align: center;
}

.empty-state strong {
    display: block;
}

.empty-state p {
    margin: 8px 0 0;
    color: var(--text-soft);
    font-size: 13px;
}

.memory-card {
    display: grid;
    gap: 30px;
    margin-top: 25px;
}

.memory-summary-block > span,
.memory-section-title {
    color: var(--primary);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.memory-summary-block p {
    margin: 13px 0 0;
    color: #3b4964;
    line-height: 1.8;
}

.memory-alert-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.memory-alert {
    padding: 13px 15px;
    border-left: 3px solid #f1b54c;
    border-radius: 0 10px 10px 0;
    background: #fff9ed;
    color: #704b11;
    font-size: 12px;
    line-height: 1.55;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(8, 13, 27, 0.58);
}

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

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

@media (max-width: 820px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 190ms ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .dashboard-main {
        margin-left: 0;
    }

    .mobile-menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 41px;
        height: 41px;
        border: 1px solid var(--border);
        border-radius: 11px;
        background: white;
        cursor: pointer;
    }

    .header-company-context {
        display: none;
    }
}

@media (max-width: 680px) {
    .dashboard-header {
        padding: 0 18px;
    }

    .header-credit,
    .user-description {
        display: none;
    }

    .dashboard-content {
        padding: 27px 18px 60px;
    }

    .welcome-block,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .welcome-block h1 {
        font-size: 34px;
    }

    .primary-action-link {
        width: 100%;
        justify-content: space-between;
    }

    .action-item,
    .history-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .action-meta,
    .history-date {
        grid-column: 2;
        text-align: left;
    }
}

/* ==========================================================
   INDICADORES FINANCEIROS
========================================================== */

.financial-indicators-section {
    margin-top: 28px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.financial-indicators-section .section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.financial-indicators-section h2 {
    margin: 6px 0 8px;
    font-size: 24px;
    line-height: 1.2;
}

.financial-indicators-section p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

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

.financial-indicator-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            var(--surface-soft) 100%
        );
}

.financial-indicator-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.financial-indicator-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 13px;
    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--purple)
        );
    color: #ffffff;
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0.03em;
}

.financial-indicator-source {
    padding: 7px 10px;
    border-radius: 999px;
    background: #edf2ff;
    color: var(--primary);
    font-size: 12px;
    font-weight: 750;
    text-align: right;
}

.financial-indicator-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.financial-indicator-label {
    min-height: 42px;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.45;
}

.financial-indicator-value {
    color: var(--text);
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.financial-indicator-footer {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 12px;
}

.financial-indicators-grid > .empty-state {
    grid-column: 1 / -1;
}

/* ==========================================================
   STATUS DO PLANO DE AÇÃO
========================================================== */

.action-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.action-title-row h3 {
    margin: 0;
}

.action-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.action-status-badge.pendente {
    background: #fff4df;
    color: var(--warning);
}

.action-status-badge.em_andamento {
    background: #eaf0ff;
    color: var(--primary);
}

.action-status-badge.concluido {
    background: #e9fbf4;
    color: var(--success);
}

.action-status-badge.cancelado {
    background: #fff0f0;
    color: var(--danger);
}

.action-status-em_andamento {
    border-left: 4px solid var(--primary);
}

/* ==========================================================
   RESPONSIVIDADE DOS INDICADORES
========================================================== */

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

@media (max-width: 680px) {
    .financial-indicators-section {
        padding: 20px;
        border-radius: 18px;
    }

    .financial-indicators-grid {
        grid-template-columns:
            minmax(0, 1fr);
    }

    .financial-indicator-card {
        padding: 18px;
    }

    .financial-indicator-value {
        font-size: 25px;
    }

    .action-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

.dashboard-charts-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(340px,1fr));
    gap:24px;
    margin-top:24px;
}

.dashboard-chart-card{
    background:#fff;
    border:1px solid #eceff5;
    border-radius:18px;
    padding:24px;
    box-shadow:0 10px 30px rgba(16,24,40,.05);
}

.chart-card-header{
    margin-bottom:20px;
}

.dashboard-chart-content{
    display:flex;
    flex-direction:column;
    gap:18px;
}

.simple-chart-row{
    display:grid;
    grid-template-columns:120px 1fr 45px;
    gap:14px;
    align-items:center;
}

.simple-chart-label{
    font-size:14px;
    font-weight:600;
    color:#334155;
}

.simple-chart-bar{
    width:100%;
    height:12px;
    background:#edf2f7;
    border-radius:999px;
    overflow:hidden;
}

.simple-chart-fill{
    height:100%;
    border-radius:999px;
}

.simple-chart-fill.primary{
    background:#4f46e5;
}

.simple-chart-fill.success{
    background:#22c55e;
}

.simple-chart-fill.warning{
    background:#f59e0b;
}

.simple-chart-fill.danger{
    background:#ef4444;
}

.simple-chart-value{
    text-align:right;
    font-weight:700;
    color:#0f172a;
}

/* ==========================================================
   HISTÓRICO COMPACTO
========================================================== */

.history-compact {
    width: 100%;
    margin-top: 20px;
}


.history-compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    padding: 20px 22px;

    border: 1px solid var(--border);
    border-radius: 18px;

    background: #ffffff;

    box-shadow:
        0 8px 25px rgba(
            22,
            35,
            74,
            0.04
        );
}


.history-compact-summary {
    display: flex;
    align-items: center;
    gap: 15px;

    min-width: 0;
}


.history-compact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    flex-shrink: 0;

    border-radius: 13px;

    background: #eef2ff;

    color: var(--primary);

    font-size: 11px;
    font-weight: 900;
}


.history-compact-summary strong {
    display: block;

    color: var(--text);

    font-size: 15px;
    font-weight: 800;
}


.history-compact-summary p {
    margin: 4px 0 0;

    color: var(--text-soft);

    font-size: 12px;
}


.history-toggle-button {
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding: 0 16px;

    flex-shrink: 0;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: #ffffff;

    color: var(--primary);

    font-size: 12px;
    font-weight: 800;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}


.history-toggle-button:hover {
    background: #f7f9ff;

    border-color: #cad4f5;

    transform: translateY(-1px);
}


.history-expandable-list {
    display: grid;
    gap: 12px;

    margin-top: 14px;
}


.history-expandable-list[hidden] {
    display: none !important;
}


.history-compact-empty {
    margin-top: 20px;

    padding: 22px;

    border: 1px dashed var(--border);
    border-radius: 17px;

    background: rgba(
        255,
        255,
        255,
        0.65
    );
}


.history-compact-empty strong {
    display: block;

    font-size: 14px;
}


.history-compact-empty p {
    margin: 5px 0 0;

    color: var(--text-soft);

    font-size: 12px;
}


/* ==========================================================
   MOBILE
========================================================== */

@media (
    max-width: 720px
) {

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


    .history-toggle-button {
        width: 100%;
    }

}

.subscription-price {
    display: none !important;
}

/* ==========================================================
   PLANO DE AÇÃO — NOVO LAYOUT
========================================================== */

.action-plan-list {
    display: block;
}


/* ==========================================================
   RESUMO
========================================================== */

.action-plan-summary {
    display: grid;

    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );

    gap: 12px;

    margin: 22px 0 18px;
}


.action-summary-item {
    padding: 16px 18px;

    border: 1px solid var(--border);
    border-radius: 15px;

    background: #ffffff;
}


.action-summary-item strong {
    display: block;

    color: var(--text);

    font-size: 22px;
    line-height: 1;
    font-weight: 850;
}


.action-summary-item span {
    display: block;

    margin-top: 7px;

    color: var(--text-soft);

    font-size: 11px;
    font-weight: 600;
}


.action-summary-priority strong {
    color: var(--danger);
}


/* ==========================================================
   LISTA
========================================================== */

.action-plan-cards {
    display: grid;
    gap: 12px;
}


.action-item-new {
    display: grid;

    grid-template-columns:
        auto
        minmax(
            0,
            1fr
        );

    gap: 18px;

    padding: 20px;

    border: 1px solid var(--border);
    border-radius: 18px;

    background: #ffffff;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}


.action-item-new:hover {
    transform:
        translateY(-2px);

    border-color:
        #ccd6ef;

    box-shadow:
        0 10px 30px
        rgba(
            22,
            35,
            74,
            0.06
        );
}


.action-item-new.action-status-em_andamento {
    border-left:
        4px solid
        var(--primary);
}


/* ==========================================================
   NUMERAÇÃO
========================================================== */

.action-step {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: #eef2ff;

    color: var(--primary);

    font-size: 12px;
    font-weight: 900;
}


/* ==========================================================
   CONTEÚDO
========================================================== */

.action-main {
    min-width: 0;
}


.action-new-header {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;
}


.action-kicker {
    display: block;

    margin-bottom: 4px;

    color: var(--text-soft);

    font-size: 9px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: 0.1em;
}


.action-new-header h3 {
    margin: 0;

    color: var(--text);

    font-size: 15px;
    line-height: 1.35;
}


.action-description {
    max-width: 900px;

    margin:
        8px 0
        15px;

    color: var(--text-soft);

    font-size: 12px;
    line-height: 1.6;
}


/* ==========================================================
   METADADOS
========================================================== */

.action-details {
    display: flex;
    align-items: center;

    gap: 12px;

    flex-wrap: wrap;
}


.action-detail {
    display: inline-flex;

    align-items: center;

    gap: 6px;

    min-height: 30px;

    padding: 5px 10px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background:
        var(--surface-soft);
}


.action-detail small {
    color: var(--text-soft);

    font-size: 9px;
}


.action-detail strong {
    color: var(--text);

    font-size: 10px;
}


.action-detail-priority.alta {
    border-color:
        #ffd8d8;

    background:
        #fff4f4;
}


.action-detail-priority.alta strong {
    color:
        var(--danger);
}


.action-detail-priority.media {
    border-color:
        #f5dfad;

    background:
        #fff9ec;
}


.action-detail-priority.media strong {
    color:
        var(--warning);
}


.action-detail-priority.baixa {
    border-color:
        #cdeee1;

    background:
        #effbf6;
}


.action-detail-priority.baixa strong {
    color:
        var(--success);
}


/* ==========================================================
   VER TODAS
========================================================== */

.action-show-more {
    width: 100%;

    min-height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    margin-top: 14px;

    border:
        1px solid
        var(--border);

    border-radius: 13px;

    background:
        #ffffff;

    color:
        var(--primary);

    font-size: 12px;
    font-weight: 800;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}


.action-show-more:hover {
    background:
        #f7f9ff;

    border-color:
        #cad4f5;
}


.action-extra[hidden] {
    display: none !important;
}


/* ==========================================================
   RESPONSIVO
========================================================== */

@media (
    max-width: 900px
) {

    .action-plan-summary {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

}


@media (
    max-width: 620px
) {

    .action-plan-summary {
        grid-template-columns:
            1fr
            1fr;
    }


    .action-item-new {
        grid-template-columns:
            1fr;
    }


    .action-step {
        width: 32px;
        height: 32px;
    }


    .action-new-header {
        flex-direction: column;
    }


    .action-status-badge {
        align-self: flex-start;
    }

}

/* ==========================================================
   GERENCIAMENTO DA ASSINATURA
========================================================== */

.subscription-management {
    display: grid;
    gap: 12px;

    margin-top: 18px;
    padding-top: 18px;

    border-top:
        1px solid
        var(--border);
}


/* ==========================================================
   CANCELAR ASSINATURA
========================================================== */

.subscription-cancel-button {
    width: 100%;

    min-height: 42px;

    border:
        1px solid
        #e2bcbc;

    border-radius: 11px;

    background:
        #ffffff;

    color:
        var(--danger);

    font-size: 11px;
    font-weight: 800;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        opacity 0.2s ease;
}


.subscription-cancel-button:hover {
    background:
        #fff5f5;

    border-color:
        #dc9d9d;
}


.subscription-cancel-button:disabled {
    opacity: 0.55;
    cursor: wait;
}


.subscription-management-help {
    margin: 0;

    color:
        var(--text-soft);

    font-size: 10px;
    line-height: 1.5;

    text-align: center;
}


/* ==========================================================
   AVISOS DA ASSINATURA
========================================================== */

.subscription-notice {
    padding: 13px 14px;

    border-radius: 12px;

    font-size: 11px;
    line-height: 1.55;
}


.subscription-notice strong {
    display: block;

    margin-bottom: 3px;

    font-size: 11px;
}


.subscription-notice p {
    margin: 0;
}


/* CANCELAMENTO AGENDADO */

.subscription-notice.scheduled {
    border:
        1px solid
        #d8d3ff;

    background:
        #f5f3ff;

    color:
        #5947a7;
}


/* INADIMPLÊNCIA */

.subscription-notice.overdue {
    border:
        1px solid
        #f1d49d;

    background:
        #fff8e9;

    color:
        #81520c;
}


/* CANCELADA */

.subscription-notice.cancelled {
    border:
        1px solid
        #e4e7ee;

    background:
        #f6f7f9;

    color:
        #667085;
}


/* ==========================================================
   BADGES DE STATUS
========================================================== */

.status-badge.warning {
    background:
        #fff5dc;

    color:
        var(--warning);
}


.status-badge.scheduled {
    background:
        #f1efff;

    color:
        #654dc4;
}

/* ==========================================================
   AÇÕES PRINCIPAIS DO ESPECIALISTA
========================================================== */

.primary-actions-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}


.secondary-analysis-link {
    display: inline-flex;
    align-items: center;
    gap: 18px;

    min-height: 52px;
    padding: 0 21px;

    border: 1px solid var(--primary);
    border-radius: 13px;

    background: #ffffff;

    color: var(--primary);

    font-size: 14px;
    font-weight: 780;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.secondary-analysis-link:hover {
    background: #f5f7ff;

    transform:
        translateY(-1px);

    box-shadow:
        0 10px 22px
        rgba(68, 79, 239, 0.10);
}


@media (max-width: 680px) {

    .primary-actions-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }


    .primary-actions-group
    .primary-action-link,

    .primary-actions-group
    .secondary-analysis-link {
        width: 100%;
        justify-content: space-between;
    }
}