/* CORIS Board — Nova Community Dashboard */

body:has([dusk="dashboard-main"]) {
    background: #f4f6f8 !important;
}

[dusk="dashboard-main"] .space-y-3 > .flex.items-center {
    display: none !important;
}

/* Compact row/column rhythm (Nova default is gap-6 / 24px) */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 {
    row-gap: 1.25rem; /* 20px between card rows */
    column-gap: 1.25rem;
}

/* Section heading wrappers: strip Nova stretch/min-height and pull closer to cards below */
[dusk="dashboard-main"] .md\:col-span-12:has(.coris-dash-section) {
    min-height: 0 !important;
    height: auto !important;
    align-self: start;
    /* ~28px from previous section (20px row-gap + 8px) */
    margin-top: 0.5rem;
    /* ~14px to cards below (20px row-gap − 6px) */
    margin-bottom: -0.375rem;
}

[dusk="dashboard-main"] .md\:col-span-12:has(.coris-dash-section) > .coris-dash-section,
[dusk="dashboard-main"] .md\:col-span-12:has(.coris-dash-section) .coris-dash-section {
    height: auto !important;
    min-height: 0 !important;
}

/*
 * NOTE ON SELECTORS BELOW: Nova's stock Value/Table metric Vue components do not
 * render a stable per-metric class or `dusk` attribute — every metric card looks
 * identical in markup (`.rounded-lg.shadow.isolate...`) regardless of which PHP
 * metric class produced it. There is no supported hook to attach a custom class
 * per metric (Nova's `Value` metric only exposes `->icon()`, not `->color()`).
 * Card-shell rules below key off classes that genuinely exist in the rendered
 * markup (verified against the compiled output, not assumed). Color-coding is
 * necessarily positional (`nth-child` on the dashboard's cards() order in
 * app/Nova/Dashboards/Main.php) — if that card order changes, update the
 * position comments below to match.
 */

/* Card shell — every dashboard card (KPI + table) shares this structure */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div.rounded-lg.shadow.isolate {
    border: 1px solid #e8edf2;
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    background: #fff;
}

/* KPI value cards (icon + big number) */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div.rounded-lg.shadow.isolate.px-6.py-4:has(.bg-primary-500) {
    padding: 1.25rem 1.35rem 1.35rem !important;
}

[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div.rounded-lg.shadow.isolate:has(.bg-primary-500) h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.01em;
}

[dusk="dashboard-main"] .bg-primary-500 {
    width: 2.75rem !important;
    height: 2.75rem !important;
    border-radius: 0.85rem !important;
    box-shadow: none !important;
}

[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div.rounded-lg.shadow.isolate:has(.bg-primary-500) .text-4xl {
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 700;
    color: #0f172a;
}

[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div.rounded-lg.shadow.isolate:has(.bg-primary-500) .text-sm.font-bold.text-gray-400,
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div.rounded-lg.shadow.isolate:has(.bg-primary-500) .text-sm.font-bold {
    color: #94a3b8 !important;
    font-weight: 500 !important;
    font-size: 0.75rem !important;
}

/* Table / list cards (no icon) */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div.rounded-lg.shadow.isolate.pt-4 h3 {
    color: #334155;
    font-weight: 600;
}

/*
 * Category color-coding for every KPI icon, by position in Main.php's cards().
 * Grouped by meaning rather than one color per card, so the palette stays
 * coherent instead of turning into a rainbow: rose = voting/governance,
 * orange = needs attention, violet = amenities, green = healthy/resolved/
 * approved, blue = visitors/requests, teal = access, amber = packages/pending
 * review, red = violations/urgent.
 */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(1) .bg-primary-500 { background: rgba(220, 76, 104, 0.12) !important; color: #dc4c68 !important; }  /* Open Votes */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(2) .bg-primary-500 { background: rgba(234, 88, 12, 0.12) !important; color: #ea580c !important; }   /* Open Maintenance Requests */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(3) .bg-primary-500 { background: rgba(124, 58, 237, 0.12) !important; color: #7c3aed !important; }  /* Pending Amenity Reservations */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(4) .bg-primary-500 { background: rgba(22, 163, 74, 0.12) !important; color: #16a34a !important; }   /* Active Residents */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(9) .bg-primary-500 { background: rgba(37, 99, 235, 0.12) !important; color: #2563eb !important; }   /* Today's Visitors */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(10) .bg-primary-500 { background: rgba(13, 148, 136, 0.12) !important; color: #0d9488 !important; } /* Currently Checked In */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(11) .bg-primary-500,
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(12) .bg-primary-500 { background: rgba(217, 119, 6, 0.12) !important; color: #d97706 !important; } /* Packages received / waiting */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(14) .bg-primary-500,
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(15) .bg-primary-500,
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(16) .bg-primary-500 { background: rgba(220, 38, 38, 0.12) !important; color: #dc2626 !important; } /* Open Violations / High Severity / Past Due */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(17) .bg-primary-500 { background: rgba(22, 163, 74, 0.12) !important; color: #16a34a !important; }  /* Recently Resolved */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(19) .bg-primary-500 { background: rgba(37, 99, 235, 0.12) !important; color: #2563eb !important; }  /* Submitted Requests */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(20) .bg-primary-500 { background: rgba(217, 119, 6, 0.12) !important; color: #d97706 !important; }  /* Under Review */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(21) .bg-primary-500 { background: rgba(234, 88, 12, 0.12) !important; color: #ea580c !important; }  /* Changes Requested */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(22) .bg-primary-500 { background: rgba(22, 163, 74, 0.12) !important; color: #16a34a !important; }  /* Approved This Month */
[dusk="dashboard-main"] .grid.md\:grid-cols-12 > div:nth-child(24) .bg-primary-500 { background: rgba(71, 85, 105, 0.12) !important; color: #475569 !important; }  /* Residents Overview */

/* Custom dashboard cards */
.coris-dash-card {
    border: 1px solid #e8edf2;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.coris-dash-panel {
    padding: 1.25rem 1.35rem 1.35rem;
}

.coris-dash-header-card {
    padding: 1.25rem 1.35rem 1.1rem;
}

.coris-dash-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
}

.coris-dash-title {
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.15;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.coris-dash-community {
    margin: 0.5rem 0 0;
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 9999px;
    background: rgba(236, 98, 125, 0.08);
    color: #dc4c68;
    font-size: 0.8125rem;
    font-weight: 600;
}

.coris-dash-muted {
    margin: 0.35rem 0 0;
    color: #64748b;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.coris-dash-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.coris-dash-panel__title {
    margin: 0 0 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #334155;
}

.coris-dash-panel__head .coris-dash-panel__title {
    margin-bottom: 0;
}

.coris-dash-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #dc4c68;
    text-decoration: none;
}

.coris-dash-link:hover {
    color: #be123c;
    text-decoration: underline;
}

.coris-dash-link--button {
    display: inline-flex;
    margin-top: 0.75rem;
    padding: 0.45rem 0.8rem;
    border-radius: 0.65rem;
    background: rgba(236, 98, 125, 0.08);
    text-decoration: none;
}

/* Section labels — compact, glued to cards below */
.coris-dash-section {
    padding: 0;
    margin: 0;
    line-height: 1.2;
}

.coris-dash-section-card {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: 0 !important;
    height: auto !important;
}

.coris-dash-section__title {
    margin: 0;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    line-height: 1.2;
}

.coris-donut {
    width: 7.5rem;
    height: 7.5rem;
    border-radius: 9999px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.coris-donut__hole {
    width: 5.1rem;
    height: 5.1rem;
    border-radius: 9999px;
    background: #fff;
    display: grid;
    place-items: center;
}

.coris-chart-layout {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.coris-chart-layout__total {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.coris-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-width: 0;
}

.coris-legend__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.55rem;
    align-items: center;
    padding: 0.35rem 0;
    font-size: 0.8125rem;
    color: #334155;
}

.coris-legend__dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 9999px;
}

.coris-legend__value {
    font-weight: 600;
    color: #0f172a;
}

.coris-legend__pct {
    color: #94a3b8;
    font-weight: 500;
}

.coris-health {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.coris-health__score-wrap {
    text-align: center;
}

.coris-health__score {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

.coris-health__suffix {
    margin-top: 0.15rem;
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
}

.coris-health__meta {
    flex: 1;
    min-width: 0;
}

.coris-health__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.coris-health__badge--good {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.coris-health__badge--attention {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.coris-health__badge--critical {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.coris-health__stats {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #64748b;
}

.coris-amenity-bars {
    display: grid;
    gap: 0.7rem;
}

.coris-amenity-bars__row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto;
    gap: 0.65rem;
    align-items: center;
}

.coris-amenity-bars__label {
    font-size: 0.8125rem;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coris-amenity-bars__track {
    height: 0.55rem;
    border-radius: 9999px;
    background: #eef2f6;
    overflow: hidden;
}

.coris-amenity-bars__fill {
    height: 100%;
    border-radius: inherit;
}

.coris-amenity-bars__count {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #0f172a;
}

.coris-activity {
    list-style: none;
    margin: 0;
    padding: 0;
}

.coris-activity__item {
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem 0;
    border-top: 1px solid #eef2f6;
}

.coris-activity__item:first-child {
    border-top: 0;
    padding-top: 0.15rem;
}

.coris-activity__icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.coris-activity__icon svg {
    width: 1.1rem;
    height: 1.1rem;
}

.coris-activity__icon--pink {
    background: rgba(236, 98, 125, 0.12);
    color: #dc4c68;
}

.coris-activity__icon--orange {
    background: rgba(249, 115, 22, 0.12);
    color: #ea580c;
}

.coris-activity__icon--violet {
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
}

.coris-activity__icon--green {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.coris-activity__icon--slate {
    background: #f1f5f9;
    color: #64748b;
}

.coris-activity__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}

.coris-activity__meta {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}

.coris-actions {
    display: grid;
    gap: 0.55rem;
}

.coris-actions__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.8rem 0.85rem;
    border: 1px solid #eef2f6;
    border-radius: 0.85rem;
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.coris-actions__item:hover {
    border-color: rgba(236, 98, 125, 0.25);
    background: rgba(236, 98, 125, 0.03);
}

.coris-actions__icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.7rem;
    display: grid;
    place-items: center;
    background: #f8fafc;
    color: #475569;
}

.coris-actions__icon svg {
    width: 1.1rem;
    height: 1.1rem;
}

.coris-actions__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}

.coris-actions__desc {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}

.coris-actions__chevron {
    width: 1.1rem;
    height: 1.1rem;
    color: #94a3b8;
}

.coris-empty {
    display: grid;
    justify-items: center;
    text-align: center;
    padding: 1.5rem 0.75rem 0.5rem;
}

.coris-empty--compact {
    padding-top: 1rem;
}

.coris-empty__icon {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: grid;
    place-items: center;
    background: #f8fafc;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

.coris-empty__icon--violet {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

.coris-empty__icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.coris-empty__title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #334155;
}

@media (max-width: 768px) {
    .coris-health,
    .coris-chart-layout {
        flex-direction: column;
        align-items: flex-start;
    }

    .coris-dash-title {
        font-size: 1.45rem;
    }
}
