/*
 * Rossells Connect dashboard.
 * Filament 4+ only ships styles for its own components, so the dashboard widget is styled here
 * using Filament's colour variables (works with the panel colours and dark mode, no build step).
 * Registered in AppServiceProvider and published with `php artisan filament:assets`.
 */

[x-cloak] { display: none !important; }

.rc-dashboard {
    --rc-radius: 0.875rem;
    --rc-surface: #fff;
    --rc-border: var(--gray-200);
    --rc-text: var(--gray-950);
    --rc-muted: var(--gray-500);
    --rc-tint: color-mix(in oklab, var(--primary-500) 10%, transparent);
}

.dark .rc-dashboard {
    --rc-surface: var(--gray-900);
    --rc-border: color-mix(in oklab, #fff 10%, transparent);
    --rc-text: #fff;
    --rc-muted: var(--gray-400);
    --rc-tint: color-mix(in oklab, var(--primary-400) 15%, transparent);
}

.rc-stack { display: flex; flex-direction: column; gap: 2rem; color: var(--rc-text); }
.rc-section { display: flex; flex-direction: column; gap: 1rem; }
.rc-heading { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.rc-eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary-600); }
.dark .rc-eyebrow { color: var(--primary-400); }
.rc-lede { max-width: 56rem; font-size: 0.9375rem; line-height: 1.65; color: var(--rc-muted); }
.rc-link { color: var(--primary-600); font-weight: 500; }
.rc-link:hover { text-decoration: underline; }
.dark .rc-link { color: var(--primary-400); }

.rc-grid { display: grid; gap: 1rem; }
.rc-grid--tiles { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.rc-grid--three { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }

/* Upgrade notice */
.rc-notice {
    display: flex; gap: 1rem; align-items: flex-start;
    padding: 1rem 1.25rem; border-radius: var(--rc-radius);
    background: color-mix(in oklab, var(--success-500) 9%, var(--rc-surface));
    border: 1px solid color-mix(in oklab, var(--success-500) 35%, transparent);
    box-shadow: inset 4px 0 0 var(--success-500);
}
.rc-notice__icon {
    flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 9999px;
    background: color-mix(in oklab, var(--success-500) 18%, transparent); color: var(--success-600);
}
.dark .rc-notice__icon { color: var(--success-400); }
.rc-notice__icon svg { width: 1.375rem; height: 1.375rem; }
.rc-notice__body { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.875rem; line-height: 1.6; }
.rc-notice__body a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.rc-notice__title { font-weight: 600; font-size: 0.9375rem; }
.rc-notice__sign { margin-top: 0.25rem; font-size: 0.8125rem; font-weight: 500; color: var(--rc-muted); }
.rc-notice__close { flex: none; padding: 0.25rem; border-radius: 0.5rem; color: var(--rc-muted); }
.rc-notice__close:hover { background: color-mix(in oklab, var(--gray-500) 15%, transparent); color: var(--rc-text); }
.rc-notice__close svg { width: 1.25rem; height: 1.25rem; }

/* Welcome */
.rc-hero {
    position: relative; overflow: hidden;
    padding: 2rem; border-radius: calc(var(--rc-radius) + 0.25rem);
    background:
        radial-gradient(60rem 20rem at 100% 0%, color-mix(in oklab, var(--primary-500) 18%, transparent), transparent 60%),
        var(--rc-surface);
    border: 1px solid var(--rc-border);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}
.rc-hero__content { position: relative; max-width: 44rem; display: flex; flex-direction: column; gap: 0.5rem; }
.rc-hero__title { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.rc-hero__text { font-size: 1rem; line-height: 1.65; color: var(--rc-muted); }
.rc-hero__mark {
    position: absolute; right: -1.5rem; bottom: -2.5rem; width: 12rem; height: 12rem;
    color: var(--primary-500); opacity: 0.08; pointer-events: none;
}

/* Shortcut tiles */
.rc-tile {
    display: flex; align-items: center; gap: 0.875rem; padding: 1rem;
    border-radius: var(--rc-radius); background: var(--rc-surface); border: 1px solid var(--rc-border);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.rc-tile:hover { border-color: color-mix(in oklab, var(--primary-500) 50%, transparent); box-shadow: 0 6px 18px -8px rgb(0 0 0 / 0.18); transform: translateY(-1px); }
.rc-tile__icon {
    flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 0.75rem;
    background: var(--rc-tint); color: var(--primary-600);
}
.dark .rc-tile__icon { color: var(--primary-400); }
.rc-tile__icon svg { width: 1.5rem; height: 1.5rem; }
.rc-tile__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rc-tile__title { font-weight: 600; font-size: 0.9375rem; }
.rc-tile__meta { font-size: 0.8125rem; color: var(--rc-muted); }
.rc-tile__count {
    flex: none; min-width: 2rem; padding: 0.125rem 0.5rem; border-radius: 9999px; text-align: center;
    font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums;
    background: var(--rc-tint); color: var(--primary-700);
}
.dark .rc-tile__count { color: var(--primary-300); }
.rc-tile__chevron { flex: none; width: 1.25rem; height: 1.25rem; color: var(--rc-muted); transition: transform .15s; }
.rc-tile:hover .rc-tile__chevron { transform: translateX(2px); color: var(--primary-500); }

/* Highlight cards */
.rc-card {
    display: flex; flex-direction: column; gap: 0.375rem; padding: 1.25rem;
    border-radius: var(--rc-radius); background: var(--rc-surface); border: 1px solid var(--rc-border);
}
.rc-card__icon {
    display: grid; place-items: center; width: 2.5rem; height: 2.5rem; margin-bottom: 0.5rem;
    border-radius: 0.75rem; background: var(--rc-tint); color: var(--primary-600);
}
.dark .rc-card__icon { color: var(--primary-400); }
.rc-card__icon svg { width: 1.375rem; height: 1.375rem; }
.rc-card__title { font-weight: 600; }
.rc-card__text { font-size: 0.875rem; line-height: 1.6; color: var(--rc-muted); }

/* Rossells services promo */
.rc-promo {
    display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr);
    padding: 2rem; border-radius: calc(var(--rc-radius) + 0.25rem); color: #fff;
    background:
        radial-gradient(40rem 18rem at 0% 0%, rgb(255 255 255 / 0.14), transparent 60%),
        linear-gradient(135deg, var(--primary-700), var(--primary-900));
}
@media (min-width: 1024px) { .rc-promo { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; } }
.rc-promo__intro { display: flex; flex-direction: column; gap: 0.75rem; }
.rc-eyebrow--on-dark { color: rgb(255 255 255 / 0.75) !important; }
.rc-promo__title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.rc-promo__text { font-size: 0.9375rem; line-height: 1.65; color: rgb(255 255 255 / 0.85); }
.rc-promo__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.rc-btn {
    display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.625rem 1rem;
    border-radius: 0.625rem; font-size: 0.875rem; font-weight: 600; transition: background-color .15s, color .15s;
}
.rc-btn svg { width: 1.125rem; height: 1.125rem; }
.rc-btn--light { background: #fff; color: var(--primary-700); }
.rc-btn--light:hover { background: var(--primary-50); }
.rc-btn--ghost { color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.4); }
.rc-btn--ghost:hover { background: rgb(255 255 255 / 0.12); }
.rc-services { display: grid; gap: 0.625rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 480px) { .rc-services { grid-template-columns: minmax(0, 1fr); } }
.rc-service {
    display: flex; align-items: center; gap: 0.625rem; padding: 0.75rem 0.875rem; border-radius: 0.75rem;
    font-size: 0.875rem; font-weight: 500;
    background: rgb(255 255 255 / 0.08); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14);
    transition: background-color .15s;
}
.rc-service:hover { background: rgb(255 255 255 / 0.16); }
.rc-service svg { flex: none; width: 1.25rem; height: 1.25rem; opacity: 0.9; }

/* Support strip */
.rc-support {
    display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    padding: 1.25rem; border-radius: var(--rc-radius); background: var(--rc-surface); border: 1px solid var(--rc-border);
}
.rc-support__item { display: flex; gap: 0.75rem; align-items: flex-start; font-size: 0.875rem; line-height: 1.5; }
.rc-support__icon { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; background: var(--rc-tint); color: var(--primary-600); }
.dark .rc-support__icon { color: var(--primary-400); }
.rc-support__icon svg { width: 1.25rem; height: 1.25rem; }
.rc-support__label { font-weight: 600; }

/* SpaceMinder occupancy (list page) */
.rc-occ { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; margin-bottom: 0.25rem; }
.rc-occ__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.rc-occ__count { font-size: 0.8125rem; font-weight: 500; color: var(--gray-500); font-variant-numeric: tabular-nums; }
.dark .rc-occ__count { color: var(--gray-400); }
.rc-occ__bar { height: 0.5rem; border-radius: 9999px; overflow: hidden; background: var(--gray-200); }
.dark .rc-occ__bar { background: color-mix(in oklab, #fff 10%, transparent); }
.rc-occ__bar > span { display: block; height: 100%; border-radius: inherit; background: var(--success-500); transition: width .4s ease; }
.rc-occ--warning .rc-occ__bar > span { background: var(--warning-500); }
.rc-occ--full .rc-occ__bar > span { background: var(--danger-600); }
.rc-occ--off .rc-occ__bar > span { background: var(--gray-400); }
.rc-occ__note { font-size: 0.8125rem; font-weight: 500; color: var(--danger-700); }
.dark .rc-occ__note { color: var(--danger-400); }
.fi-ta-record.rc-sm-full { background: color-mix(in oklab, var(--danger-500) 6%, transparent); box-shadow: inset 4px 0 0 var(--danger-600); }

@media (max-width: 640px) {
    .rc-hero, .rc-promo { padding: 1.25rem; }
    .rc-notice { padding: 0.875rem 1rem; }
}
