@use '@/styles/breakpoints' as *;

$page-gap: 24px;
$panel-radius: 12px;
$bp-lg: 1200px;

.page {
    display: flex;
    flex-direction: column;
    gap: $page-gap;
    min-width: 0;
}

.hero {
    display: grid;
    gap: 20px;
    padding: 24px;
    border-radius: $panel-radius;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--brand-primary, #374151) 4%, #fff) 0%,
        #fff 55%
    );
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.heroTop {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.heroCopy {
    flex: 1;
    min-width: min(100%, 280px);
}

.heroTitle {
    margin: 0 0 8px !important;
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: var(--brand-primary, #374151) !important;
    letter-spacing: -0.02em;
}

.heroDescription {
    margin: 0 !important;
    max-width: 62ch;
    color: #6b7280;
    font-size: 0.9375rem;
    line-height: 1.55;
}

.heroActions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.workspace {
    display: grid;
    gap: $page-gap;
    min-width: 0;
    align-items: start;

    @media (min-width: $bp-lg) {
        grid-template-columns: minmax(0, 1fr) 320px;
    }
}

.mainPanel {
    display: flex;
    flex-direction: column;
    gap: $page-gap;
    min-width: 0;
}

.summaryPanel {
    min-width: 0;

    @media (min-width: $bp-lg) {
        position: sticky;
        top: calc(64px + var(--projeto-secondary-nav-h, 56px) + 24px);
    }
}

.summaryCard {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.statusBadge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    width: fit-content;
}

.statusOk {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.statusAtencao {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.statusAlerta {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.statusExcedido {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.summaryBlock {
    padding: 14px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
}

.summaryLabel {
    display: block;
    margin-bottom: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9ca3af;
}

.summaryValue {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
}

.summaryValueLarge {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.periodGrid {
    display: grid;
    gap: 10px;
}

.periodItem {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.8125rem;
    color: #4b5563;
}

.periodItem strong {
    color: #111827;
    font-weight: 600;
    text-align: right;
}

.progressWrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progressHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: #6b7280;
}

.progressHeader strong {
    color: #111827;
    font-size: 0.9375rem;
}

.summaryActions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quickLinks {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
    border-top: 1px solid #f3f4f6;
}

.tabsCard :global(.ant-tabs-nav) {
    margin-bottom: 16px;
}

.monoArea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    white-space: pre-wrap;
}

.loadingWrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    color: #6b7280;
}

.inlineAlerts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@include max-mobile {
    .hero {
        padding: 18px 16px;
    }

    .heroActions :global(.ant-btn) {
        flex: 1 1 auto;
    }

    .summaryActions :global(.ant-btn) {
        width: 100%;
    }
}
