/* Home page: constrain to 1440px max-width, centered */
.home-page {
    width: 100% !important;
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    padding: 0 !important;
}

/* Homepage Carousel Styles */

/* Wide screens: 3 full slides (default slideSize="33.33%") */
/* Smaller screens (max-width: 1024px): 1 full + 2 halves (slideSize="80%") */
@container main-content (max-width: 1024px) {
    #homepage-carousel .mantine-Carousel-slide,
    #homepage-carousel [class*="Carousel-slide"],
    #homepage-carousel [class*="embla__slide"] {
        min-width: 80% !important;
        flex: 0 0 80% !important;
        max-width: 80% !important;
    }
}

/* Center text on carousel slides */
#homepage-carousel .mantine-Carousel-slide > *,
#homepage-carousel [class*="Carousel-slide"] > * {
    text-align: center;
}

/* Carousel slide: black 0.5 overlay above bg-wave.jpg, beneath icon + text */
#homepage-carousel a[href] > div {
    position: relative;
}
#homepage-carousel a[href] > div::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 0;
    border-radius: inherit;
}
#homepage-carousel a[href] > div > div {
    position: relative;
    z-index: 1;
}

/* Style carousel control buttons (prev/next) */
#homepage-carousel .mantine-Carousel-control {
    opacity: 1;
    border-radius: var(--app-radius, 8px) !important;
    background-color: hsl(var(--background)) !important;
    color: hsl(var(--foreground)) !important;
    height: 32px !important;
    width: 32px !important;
}

#homepage-carousel .mantine-Carousel-control svg,
#homepage-carousel .mantine-Carousel-control > svg,
#homepage-carousel [class*="Carousel-control"] svg {
    fill: hsl(var(--foreground)) !important;
    stroke: hsl(var(--foreground)) !important;
    stroke-width: 0.5 !important;
    height: 24px !important;
    width: 24px !important;
}
#homepage-carousel .mantine-Carousel-control:hover {
    background-color: hsl(var(--accent)) !important;
    opacity: 1;
}

#homepage-carousel .mantine-Carousel-control[data-inactive],
#homepage-carousel [class*="Carousel-control"][data-inactive] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Hero CTAs on dark background */
.home-hero .hero-logo {
    display: block;
    width: clamp(108px, 11.76vw, 147px);
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 640px) {
    .home-hero .hero-logo {
        width: min(118px, 34.3vw);
    }
}

.home-hero .home-hero-cta-primary {
    background-color: hsl(var(--accent-brand)) !important;
    color: white !important;
    border: none !important;
}

.home-hero .home-hero-cta-secondary {
    border: 2px solid rgba(255, 255, 255, 0.9) !important;
    color: white !important;
    background: transparent !important;
}

.home-hero .home-hero-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
}

/* Top row: two equal columns, responsive at 1024px */
.home-top-row {
    grid-template-columns: 1fr;
}

.home-data-cards-grid,
.home-alerts-panel {
    min-width: 0;
}

@container main-content (min-width: 1024px) {
    .home-top-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Workflow snapshot cards: 3 columns desktop, stacked on mobile */
.home-workflow-grid {
    grid-template-columns: 1fr;
}

@container main-content (min-width: 1024px) {
    .home-workflow-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Workflow sections (no outer cards) */
.home-workflow-section {
    min-width: 0;
}

/* Shared compact chip used in prototype sections */
.home-workflow-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    color: #111111;
    background-color: hsl(var(--muted));
}

.home-workflow-chip--destructive {
    color: #111111;
    background-color: hsl(var(--destructive) / 0.22);
    border: 1px solid hsl(var(--destructive) / 0.35);
}

.home-workflow-chip--warning {
    color: #111111;
    background-color: #fef08a;
    border: 1px solid #facc15;
}

.home-workflow-chip--muted {
    color: #111111;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
}

.home-workflow-chip--info {
    color: #111111;
    background-color: #bfdbfe;
    border: 1px solid #3b82f6;
}

.home-workflow-chip--success {
    color: #111111;
    background-color: #bbf7d0;
    border: 1px solid #22c55e;
}

/* Recent activity grouping and recency emphasis */
.home-workflow-group-label {
    padding-left: 4px;
}

/* Data source summary line for instant confidence */
.home-data-status-summary-wrap {
    background-color: hsl(var(--destructive) / 0.08);
    border-color: hsl(var(--destructive) / 0.25) !important;
}

@container main-content (min-width: 1024px) {
    .home-workflow-section {
        padding: 0 22px;
    }

    .home-workflow-section:first-child {
        padding-left: 0;
    }

    .home-workflow-section:last-child {
        padding-right: 0;
    }

    .home-workflow-section:not(:last-child) {
        border-right: 1px solid hsl(var(--border));
    }
}

/* DataCard: value stack; status % as chip top-right (matches workflow chip palette) */
.home-data-card {
    position: relative;
    padding-top: 24px !important;
}

.home-data-card:has(.data-card__value .home-data-card__sub) .data-card__label {
    padding-right: 5.5rem;
}

.home-data-card .data-card__value {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
    font-size: inherit !important;
    font-weight: inherit !important;
}

.home-data-card__value {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--data-card-value) !important;
}

/* Status chip: shared shell; positioned top-right of card */
.home-data-card .data-card__value .home-data-card__sub {
    position: absolute;
    top: 16px;
    right: 16px;
    margin: 0 !important;
    z-index: 1;
    color: #111111 !important;
    border-radius: var(--radius-md);
    padding: 2px 10px;
    display: inline-flex;
    align-items: center;
    line-height: 1.4;
    box-sizing: border-box;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
}

/* KPI % chip: neutral low-priority highlight (same as .home-workflow-chip--muted) */
.home-data-card__sub--neutral {
    background-color: #f3f4f6 !important;
    border: 1px solid #d1d5db !important;
}

.home-data-card .data-card__value .home-data-card__sub.home-data-card__sub--success {
    color: hsl(var(--success)) !important;
}

.home-data-card .data-card__value .home-data-card__sub.home-data-card__sub--destructive {
    color: hsl(var(--destructive)) !important;
}

.home-data-card .data-card__value .home-data-card__sub.home-data-card__sub--muted {
    color: hsl(var(--muted-foreground, 0 0% 45%)) !important;
}

.home-data-card__sub:empty {
    display: none;
}

/* Charts section: line (2 cols) | donut (1 col), responsive */
.home-charts-section {
    width: 100%;
    grid-template-columns: 1fr;
}

@container main-content (min-width: 1024px) {
    .home-charts-section {
        grid-template-columns: 2fr 1fr;
    }
}

/* Alerts panel: improved list styling */
.home-alerts-panel .home-alert-item {
    transition: background-color 0.15s ease;
}

/* Alert item type variants - border + subtle bg tint */
.home-alert-item--warning {
    background-color: hsl(var(--warning) / 0.1) !important;
}

.home-alert-item--destructive {
    background-color: hsl(var(--destructive) / 0.08) !important;
}

.home-alert-item--success {
    background-color: hsl(var(--success) / 0.1) !important;
}

.home-alert-item--muted {
    background-color: hsl(var(--muted) / 0.3) !important;
}



/* Alerts list spacing - 6px gap between items */
.home-alerts-panel ul {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Feature cards grid */
.home-feature-card .custom-button {
    margin-top: 0;
}

/* Keep Quick Action "Open" button full width in all sidebar states */
.home-feature-card .home-feature-card__buttons > .custom-button:not(.home-feature-card__pin-toggle),
.home-feature-card .home-feature-card__buttons > a.custom-button:not(.home-feature-card__pin-toggle),
.home-feature-card .home-feature-card__buttons > button.custom-button:not(.home-feature-card__pin-toggle) {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    display: flex !important;
}

.home-feature-card__header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.home-feature-card__pin-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid hsl(var(--border));
    border-radius: var(--app-radius, 8px);
    background: hsl(var(--background));
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.home-feature-card__pin-toggle.custom-button {
    padding: 0 !important;
}

.home-feature-card__pin-toggle .button-icon svg,
.home-feature-card__pin-toggle .button-icon [class*="lucide-icon"] {
    width: 20px !important;
    height: 20px !important;
}

.home-feature-card__pin-toggle:hover {
    border-color: hsl(var(--accent-brand));
    background: hsl(var(--accent-brand) / 0.08);
}

.home-feature-card__pin-toggle--active {
    border-color: hsl(var(--accent-brand));
    background: hsl(var(--accent-brand) / 0.12);
    color: hsl(var(--accent-brand)) !important;
}

.home-feature-card__pin-toggle--inactive {
    border-color: hsl(var(--border));
    color: hsl(var(--muted-foreground, 0 0% 45%)) !important;
}

/* Feature cards: 3 columns */
.home-feature-cards-grid {
    grid-template-columns: repeat(3, 1fr);
}

@container main-content (max-width: 1024px) {
    .home-feature-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@container main-content (max-width: 640px) {
    .home-feature-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Chart styling */
.home-charts-section .mantine-AreaChart-area,
.home-charts-section .mantine-BarChart-bar {
    fill-opacity: 0.8;
}

.home-charts-section .mantine-BarChart-axis,
.home-charts-section [class*="BarChart-axis"] {
    stroke: hsl(0, 0%, 75%) !important;
}

.home-charts-section .mantine-DonutChart-segment {
    stroke-width: 1;
    opacity: 0.9;
}
