﻿/* ========== Base ========== */
:root {
    --bg0: #060612;
    --bg1: #0b0b1d;
    --card: #0f1223cc; /* glass */
    --cardBorder: #ffffff14;
    --text: #E9ECF6;
    --muted: #B7BED6;
    --muted2: #8E97B8;
    --input: #0b0d18cc;
    --inputBorder: #ffffff14;
    --gradA: #9b7bff;
    --gradB: #ff6fb1;
    --shadow: 0 24px 70px rgba(0,0,0,.55);
    --radius: 22px;
}

html, body {
    height: 100%;
    width: 100%;
    
}

body {
    margin: 0;
    color: var(--text);
    background: radial-gradient(1200px 700px at 20% 10%, rgba(155,123,255,.18), transparent 60%), radial-gradient(900px 650px at 85% 35%, rgba(255,111,177,.14), transparent 60%), radial-gradient(900px 650px at 40% 90%, rgba(120,140,255,.10), transparent 55%), linear-gradient(180deg, var(--bg1), var(--bg0));
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

/* Make default Bootstrap text behave */
a {
    color: rgba(255,255,255,.88);
    text-decoration: none;
}

    a:hover {
        color: white;
        text-decoration: underline;
    }

.muted {
    color: var(--muted);
    opacity: .9;
}

.muted2 {
    color: var(--muted2);
}

/* ========== Ambient sparkles layer ========== */
.rb-ambient {
    position: fixed;
    inset: 0; /* top/right/bottom/left = 0 */
    width: 100%; /* NOT 100vw */
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

    .rb-ambient::before {
        content: "";
        position: absolute;
        inset: -20%;
        background: radial-gradient(circle at 15% 20%, rgba(155,123,255,.45) 0 2px, transparent 3px), radial-gradient(circle at 40% 25%, rgba(255,111,177,.35) 0 2px, transparent 3px), radial-gradient(circle at 70% 30%, rgba(155,123,255,.35) 0 2px, transparent 3px), radial-gradient(circle at 80% 45%, rgba(255,111,177,.35) 0 2px, transparent 3px), radial-gradient(circle at 20% 60%, rgba(155,123,255,.25) 0 2px, transparent 3px), radial-gradient(circle at 55% 70%, rgba(255,111,177,.22) 0 2px, transparent 3px);
        filter: blur(0.2px);
        opacity: .55;
        animation: rbFloat 14s ease-in-out infinite;
        transform: translate3d(0,0,0);
        width: 100%;
    }

@keyframes rbFloat {
    0% {
        transform: translate3d(0,0,0) scale(1);
    }

    50% {
        transform: translate3d(-18px, 12px, 0) scale(1.02);
    }

    100% {
        transform: translate3d(0,0,0) scale(1);
    }
}

/* ========== Layout ========== */
.rb-app {
    position: relative;
    z-index: 1;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.rb-topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(14px);
    background: linear-gradient(180deg, rgba(10,10,25,.70), rgba(10,10,25,.35));
    border-bottom: 1px solid var(--cardBorder);
}

    .rb-topbar .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 12px;
    }

.rb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: .2px;
}

.rb-logo {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(155,123,255,.95), rgba(255,111,177,.95));
    box-shadow: 0 14px 30px rgba(0,0,0,.25);
}

.rb-nav a {
    opacity: .86;
    margin-left: 12px;
    padding: 8px 10px;
    border-radius: 12px;
}

    .rb-nav a:hover {
        opacity: 1;
        background: rgba(255,255,255,.06);
        text-decoration: none;
    }

.rb-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 12px;
    width: 100%;
}

/* ========== Card / form styling ========== */
.rb-card {
    width: min(700px, 96vw);
    background: var(--card);
    border: 1px solid var(--cardBorder);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    padding: 22px;
}

    .rb-card h1, .rb-card h2 {
        margin: 0 0 8px;
    }

.rb-subtitle {
    margin: 0 0 18px;
    color: var(--muted2);
}

.rb-input, .rb-textarea {
    width: 100%;
    background: var(--input);
    border: 1px solid var(--inputBorder);
    color: var(--text);
    border-radius: 16px;
    padding: 12px 14px;
    outline: none;
}

    .rb-input:focus, .rb-textarea:focus {
        border-color: rgba(155,123,255,.55);
        box-shadow: 0 0 0 4px rgba(155,123,255,.14);
    }

.rb-btn {
    border: 0;
    border-radius: 16px;
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 700;
}

.rb-btn-primary {
    width: 100%;
    color: #1b1022;
    background: linear-gradient(90deg, var(--gradA), var(--gradB));
    box-shadow: 0 18px 38px rgba(155,123,255,.18);
}

    .rb-btn-primary:hover {
        filter: brightness(1.05);
    }

.rb-footer {
    padding: 18px 12px;
    text-align: center;
    color: rgba(255,255,255,.55);
    font-size: 13px;
}

/* =========================
   Bootstrap overrides (dark theme)
   ========================= */

.card {
    background: var(--card) !important;
    border: 1px solid var(--cardBorder) !important;
    color: var(--text) !important;
    border-radius: var(--radius) !important;
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

    .card .text-muted {
        color: var(--muted2) !important;
    }

    .card a {
        color: rgba(255,255,255,.88) !important;
    }

/* Make tables not blind-white */
.table {
    color: var(--text) !important;
}

    .table thead th {
        color: rgba(255,255,255,.75) !important;
        border-bottom: 1px solid var(--cardBorder) !important;
    }

    .table td, .table th {
        border-top: 1px solid rgba(255,255,255,.08) !important;
    }

/* Kill Bootstrap "text-dark" inside nav/partials */
.rb-nav .text-dark,
.rb-nav a.text-dark,
.rb-nav .nav-link.text-dark {
    color: rgba(255,255,255,.86) !important;
}

/* Identity partial alignment */
.rb-auth {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-left: 14px;
    margin-top: 12px;
}

    .rb-auth .hello {
        color: rgba(255,255,255,.70);
        font-size: 14px;
    }

    .rb-auth .logout-btn {
        background: rgba(255,255,255,.08);
        color: rgba(255,255,255,.86);
        border: 1px solid rgba(255,255,255,.14);
        border-radius: 14px;
        padding: 8px 12px;
        cursor: pointer;
        font-weight: 600;
    }

        .rb-auth .logout-btn:hover {
            background: rgba(255,255,255,.12);
        }

/* =========================
   FullCalendar darkening
   ========================= */
.rb-card .fc,
.card .fc {
    color: var(--text);
}

.rb-card .fc-theme-standard .fc-scrollgrid,
.card .fc-theme-standard .fc-scrollgrid,
.rb-card .fc-theme-standard td,
.rb-card .fc-theme-standard th,
.card .fc-theme-standard td,
.card .fc-theme-standard th {
    border-color: rgba(255,255,255,.10) !important;
}

.rb-card .fc .fc-toolbar-title,
.card .fc .fc-toolbar-title {
    color: rgba(255,255,255,.90);
}

.rb-card .fc .fc-button,
.card .fc .fc-button {
    background: rgba(255,255,255,.10) !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    color: rgba(255,255,255,.88) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
}

    .rb-card .fc .fc-button:hover,
    .card .fc .fc-button:hover {
        background: rgba(255,255,255,.14) !important;
    }

.rb-card .fc .fc-button-primary:not(:disabled).fc-button-active,
.card .fc .fc-button-primary:not(:disabled).fc-button-active {
    background: linear-gradient(90deg, var(--gradA), var(--gradB)) !important;
    border-color: transparent !important;
    color: #1b1022 !important;
}

.rb-card .fc .fc-daygrid-day-number,
.card .fc .fc-daygrid-day-number {
    color: rgba(255,255,255,.78) !important;
}

.rb-card .fc .fc-daygrid-day.fc-day-today,
.card .fc .fc-daygrid-day.fc-day-today {
    background: rgba(155,123,255,.10) !important;
}

.rb-card .fc .fc-event,
.card .fc .fc-event {
    border: 1px solid rgba(255,255,255,.14) !important;
    background: rgba(155,123,255,.18) !important;
    color: rgba(255,255,255,.92) !important;
}

/* If your admin hub uses <a class="admin-card"> */
.admin-card {
    display: block;
    background: var(--card);
    border: 1px solid var(--cardBorder);
    border-radius: var(--radius);
    padding: 18px;
    color: var(--text);
    box-shadow: var(--shadow);
    text-decoration: none;
}

    .admin-card:hover {
        background: rgba(255,255,255,.06);
        text-decoration: none;
    }

    .admin-card p {
        color: var(--muted2);
        margin: 8px 0 0;
    }

.rb-card .fc,
.rb-card .fc .fc-view-harness,
.rb-card .fc .fc-scrollgrid,
.rb-card .fc .fc-scrollgrid-section > * {
    background: transparent !important;
}

/* =========================
   Modal (event popup) theme
   ========================= */

.rb-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 9999;
}

    .rb-backdrop.hidden {
        display: none;
    }

.rb-modal {
    width: min(980px, 96vw);
    background: var(--card);
    border: 1px solid var(--cardBorder);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    padding: 18px;
    color: var(--text);
}

    .rb-modal .modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(255,255,255,.10);
        margin-bottom: 14px;
    }

        .rb-modal .modal-header h2 {
            margin: 0;
            font-size: 20px;
            color: rgba(255,255,255,.92);
        }

    .rb-modal .label {
        display: block;
        margin: 10px 0 8px;
        color: rgba(255,255,255,.78);
        font-weight: 600;
    }

    .rb-modal .grid2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

@media (max-width: 760px) {
    .rb-modal .grid2 {
        grid-template-columns: 1fr;
    }
}

.rb-modal .modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.rb-modal .spacer {
    flex: 1;
}

/* Theme buttons used in modal */
.rb-modal .btn {
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.88);
    border-radius: 14px;
    padding: 10px 14px;
    font-weight: 700;
}

    .rb-modal .btn:hover {
        background: rgba(255,255,255,.12);
    }

.rb-modal .btn-primary {
    border: 0;
    background: linear-gradient(90deg, var(--gradA), var(--gradB));
    color: #1b1022;
}

.rb-modal .btn-danger {
    border: 1px solid rgba(255,90,120,.35);
    background: rgba(255,90,120,.14);
    color: rgba(255,255,255,.92);
}

.rb-modal .btn-ghost {
    background: rgba(255,255,255,.06);
}

/* Theme inputs used in modal */
.rb-modal .input {
    width: 100%;
    background: var(--input);
    border: 1px solid var(--inputBorder);
    color: var(--text);
    border-radius: 16px;
    padding: 12px 14px;
    outline: none;
}

    .rb-modal .input:focus {
        border-color: rgba(155,123,255,.55);
        box-shadow: 0 0 0 4px rgba(155,123,255,.14);
    }

.rb-modal #closeModal {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
}

/* =========================
   Calendar responsiveness
   ========================= */

/* allow the calendar to breathe inside the card */
.rb-card #calendar {
    width: 100%;
}

/* If screen is narrow, don't let the grid squish; allow horizontal scroll */
@media (max-width: 520px) {
    .rb-card #calendar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

        /* Force a minimum canvas width so it scrolls instead of compressing */
        .rb-card #calendar .fc {
            min-width: 560px;
        }

    /* tighten card padding so calendar fills space */
    .rb-card {
        padding: 14px;
    }

        /* smaller header */
        .rb-card .fc .fc-toolbar-title {
            font-size: 20px !important;
        }

        /* toolbar buttons smaller */
        .rb-card .fc .fc-button {
            padding: 8px 10px !important;
            font-size: 12px !important;
            border-radius: 12px !important;
        }

        /* day header + numbers smaller */
        .rb-card .fc .fc-col-header-cell-cushion {
            font-size: 12px !important;
        }

        .rb-card .fc .fc-daygrid-day-number {
            font-size: 12px !important;
        }

        /* events smaller so they don't clip */
        .rb-card .fc .fc-event-title {
            font-size: 12px !important;
        }
}

/* iPad mini-ish: still tighten, but no need to force scroll */
@media (min-width: 521px) and (max-width: 820px) {
    .rb-card {
        padding: 16px;
    }

        .rb-card .fc .fc-toolbar-title {
            font-size: 22px !important;
        }
}

/* =========================
   Dashboard shell (sidebar + topbar)
   ========================= */

.rb-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 92px 1fr;
    position: relative;
    z-index: 1;
    width: 100%;
}

.rb-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(255,255,255,.10);
    background: linear-gradient(180deg, rgba(10,10,25,.75), rgba(10,10,25,.35));
    backdrop-filter: blur(14px);
}

.rb-sidebrand {
    display: flex;
    justify-content: center;
    padding: 16px 0 10px;
}

.rb-mark {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 22px;
    color: #1b1022;
    background: linear-gradient(135deg, var(--gradA), var(--gradB));
    box-shadow: 0 18px 35px rgba(0,0,0,.35);
}

.rb-sidenav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 10px;
    align-items: center;
}

.rb-sideitem {
    width: 72px;
    padding: 12px 10px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
}

    .rb-sideitem:hover {
        background: rgba(255,255,255,.06);
        color: rgba(255,255,255,.92);
        text-decoration: none;
    }

    .rb-sideitem.rb-active {
        background: rgba(155,123,255,.14);
        border: 1px solid rgba(155,123,255,.22);
        color: rgba(255,255,255,.95);
    }

.rb-ico {
    font-size: 20px;
    line-height: 1;
}

.rb-sidecaption {
    font-size: 11px;
    color: rgba(255,255,255,.60);
}

/* Main panel */
.rb-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%
}

.rb-top {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    background: linear-gradient(180deg, rgba(10,10,25,.70), rgba(10,10,25,.35));
    backdrop-filter: blur(14px);
}

.rb-search {
    flex: 1;
    max-width: 560px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    padding: 10px 12px;
}

.rb-search-ico {
    opacity: .75;
}

.rb-search-input {
    width: 100%;
    background: transparent;
    border: 0;
    outline: none;
    color: rgba(255,255,255,.90);
}

.rb-topright {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rb-topicon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    color: rgba(255,255,255,.85);
    text-decoration: none;
}

    .rb-topicon:hover {
        background: rgba(255,255,255,.10);
        color: rgba(255,255,255,.95);
        text-decoration: none;
    }

.rb-content {
    padding: 26px 22px 34px;
}

/* Make LoginPartial (rb-auth) fit topbar */
.rb-auth {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .rb-auth .hello {
        color: rgba(255,255,255,.72);
        font-size: 14px;
    }

    .rb-auth .logout-btn {
        background: rgba(255,255,255,.06);
        border: 1px solid rgba(255,255,255,.12);
        color: rgba(255,255,255,.88);
        border-radius: 16px;
        padding: 10px 14px;
        font-weight: 700;
    }

/* Responsive: collapse sidebar a bit */
@media (max-width: 720px) {
    .rb-shell {
        grid-template-columns: 78px 1fr;
    }

    .rb-sideitem {
        width: 62px;
        border-radius: 16px;
    }

    .rb-content {
        padding: 18px 14px 26px;
    }

    .rb-search {
        max-width: 320px;
    }
}

/* FullCalendar toolbar grouped buttons */
.rb-card .fc .fc-button-group {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 16px;
    padding: 4px;
}

    .rb-card .fc .fc-button-group .fc-button {
        border: 0 !important;
        background: transparent !important;
    }

        .rb-card .fc .fc-button-group .fc-button.fc-button-active {
            background: linear-gradient(90deg, var(--gradA), var(--gradB)) !important;
            color: #1b1022 !important;
        }

/* =========================
   Calendar: big "page" layout
   ========================= */

.page-shell.page-shell-wide {
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.rb-card.rb-card-calendar {
    width: 100% !important;
    padding: 18px;
    border-radius: 26px;
}

    .rb-card.rb-card-calendar #calendar {
        height: calc(100vh - 120px);
        min-height: 620px;
    }

    .rb-card.rb-card-calendar .fc {
        height: 100% !important;
    }

/* Full-bleed content for wide pages (Calendar) */
.rb-content:has(.page-shell-wide) {
    padding-left: 10px !important;
    padding-right: 10px !important;
    max-width: none !important;
    margin: 0 !important;
}

/* If your rb-content is actually centered via auto margins */
.rb-content:has(.page-shell-wide) {
    width: 100% !important;
}

/* Optional: remove extra centering on the page shell itself */
.page-shell.page-shell-wide {
    margin: 0 !important;
}

/* =========================
   Dashboard
   ========================= */

.dash-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.dash-title {
    margin: 0;
}

.dash-actions {
    display: flex;
    gap: 10px;
}

.rb-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 18px;
    font-weight: 800;
    text-decoration: none;
    color: #1b1022;
    background: linear-gradient(90deg, var(--gradA), var(--gradB));
    box-shadow: 0 18px 35px rgba(0,0,0,.25);
}

    .rb-cta:hover {
        filter: brightness(1.02);
        text-decoration: none;
    }

.dash-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 14px;
}

.dash-card {
    padding: 18px;
}

.dash-card-wide {
    grid-column: 1 / -1;
}

.dash-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

    .dash-card-head h2 {
        margin: 0;
        font-size: 18px;
    }

.dash-link {
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-weight: 700;
}

    .dash-link:hover {
        color: rgba(255,255,255,.95);
        text-decoration: none;
    }

.dash-empty {
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.05);
}

.dash-empty-title {
    font-weight: 900;
    color: rgba(255,255,255,.92);
    margin-bottom: 6px;
}

.dash-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    text-decoration: none;
    color: rgba(255,255,255,.92);
}

    .dash-item:hover {
        background: rgba(255,255,255,.07);
        text-decoration: none;
        color: rgba(255,255,255,.95);
    }

.dash-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: rgba(255,255,255,.88);
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    margin-bottom: 8px;
}

.dash-item-title {
    font-weight: 900;
}

.dash-item-sub {
    margin-top: 4px;
    font-size: 13px;
}

.dash-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: rgba(155,123,255,.14);
    border: 1px solid rgba(155,123,255,.22);
    color: rgba(255,255,255,.92);
    height: fit-content;
}

/* Recent table */
.dash-table {
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.10);
}

.dash-row {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr;
    gap: 10px;
    padding: 12px 14px;
    align-items: center;
}

.dash-row-head {
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.70);
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.dash-row-link {
    text-decoration: none;
    color: rgba(255,255,255,.92);
    background: rgba(255,255,255,.03);
    border-top: 1px solid rgba(255,255,255,.08);
}

    .dash-row-link:hover {
        background: rgba(255,255,255,.06);
        text-decoration: none;
    }

.dash-strong {
    font-weight: 900;
}

.dash-date {
    color: rgba(255,255,255,.76);
}

/* Responsive */
@media (max-width: 980px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }

    .dash-row {
        grid-template-columns: 1fr;
    }
}

/* =========================
   Dashboard layout fixes
   ========================= */

/* Keep dashboard content readable on ultrawide displays */
.page-shell .dash-head,
.page-shell .dash-grid {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Give the dashboard some breathing room from edges */
.page-shell {
    padding-left: 24px;
    padding-right: 24px;
}

/* Better grid: tighter columns + better spacing */
.dash-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 18px;
    align-items: start;
    min-width: 0;
}

/* Recently added spans full width */
.dash-card-wide {
    grid-column: 1 / -1;
}

/* Keep cards consistent */
.dash-card {
    padding: 18px;
}

/* CTA alignment: keep it near header content, not far right */
.dash-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

/* On smaller screens, stack */
@media (max-width: 980px) {
    .page-shell {
        padding-left: 14px;
        padding-right: 14px;
    }

        .page-shell .dash-head,
        .page-shell .dash-grid {
            max-width: 100%;
        }

    .dash-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard: responsive wrapping fixes */
.dash-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 18px;
    align-items: start;
}

    .dash-grid > * {
        min-width: 0; /* IMPORTANT */
    }

/* Recent table */
.dash-table {
    overflow-x: auto;
}

.dash-row {
    min-width: 640px;
}

/* Wrap earlier */
@media (max-width: 1200px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }

    .dash-card-wide {
        grid-column: auto;
    }

    .dash-row {
        min-width: 0;
        grid-template-columns: 1fr;
    }
}

/* Dashboard overflow hard-fix */
.dash-grid, .dash-card, .dash-table, .dash-row, .dash-item {
    min-width: 0;
}

/* Stop the recent table from forcing width */
.dash-table {
    max-width: 100%;
    overflow-x: auto;
}

/* If your table rows were given a min-width earlier, remove it */
.dash-row {
    min-width: 0 !important;
}

/* Make sure card contents can shrink inside the grid */
.dash-card * {
    min-width: 0;
}

/* Prevent long text from pushing width */
.dash-item-title,
.dash-strong,
.dash-item-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Dashboard: hard clamp to container ---- */
.page-shell {
    box-sizing: border-box;
}

    .page-shell .dash-grid,
    .page-shell .dash-head {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

/* Make sure grid can shrink and never spill past padding */
.dash-grid {
    margin: 0 !important;
    padding: 0 !important;
    justify-items: stretch;
    align-content: start;
}

    /* Grid children must be allowed to shrink */
    .dash-grid > * {
        min-width: 0;
        max-width: 100%;
    }

/* Cards must not exceed their grid cell */
.dash-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* If you have any "full-bleed" rules still applied */
.dash-grid,
.dash-card {
    overflow: hidden;
}

.rb-divider {
    border: 0;
    border-top: 1px solid rgba(255,255,255,.10);
    margin: 18px 0;
}

.rb-tasks.hidden {
    display: none;
}

.rb-tasks-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.rb-tasks-title {
    font-weight: 850;
    font-size: 1.05rem;
}

.rb-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0 12px;
}

.rb-task {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
}

    .rb-task label {
        margin: 0;
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

.rb-task-title {
    font-weight: 750;
}

.rb-task-meta {
    margin-left: auto;
    opacity: .75;
    font-size: .92rem;
    white-space: nowrap;
}

.rb-task-add {
    display: grid;
    grid-template-columns: 1fr 240px auto;
    gap: 10px;
}

@media (max-width: 640px) {
    .rb-task-add {
        grid-template-columns: 1fr;
    }
}

.dash-tasks {
    display: grid;
    gap: 14px;
}

.dash-tasks-group {
    display: grid;
    gap: 10px;
}

.dash-tasks-group-title {
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.65);
}

.dash-task {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
}

.dash-task-check {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0;
}

    .dash-task-check input {
        width: 16px;
        height: 16px;
        accent-color: #b57cff; /* ok to hardcode or replace w/ var */
    }

.dash-task-title {
    font-weight: 600;
    color: rgba(255,255,255,.92);
}

.dash-task-meta {
    font-size: 13px;
    color: rgba(255,255,255,.65);
    text-decoration: none;
}

    .dash-task-meta:hover {
        text-decoration: underline;
    }

.dash-link {
    color: rgba(255,255,255,.8);
    text-decoration: none;
    font-weight: 600;
}

    .dash-link:hover {
        text-decoration: underline;
    }

.rb-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.rb-toggle {
    display: flex;
    gap: 10px;
    align-items: center;
    user-select: none;
    cursor: pointer;
}

    .rb-toggle input {
        width: 16px;
        height: 16px;
        accent-color: #b57cff;
    }

.rb-tasklist {
    display: grid;
    gap: 12px;
}

.rb-taskrow {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
}

.rb-taskrow-left {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 0;
    cursor: pointer;
}

    .rb-taskrow-left input {
        margin-top: 4px;
        width: 16px;
        height: 16px;
        accent-color: #b57cff;
    }

.rb-taskrow-title {
    font-weight: 650;
    color: rgba(255,255,255,.92);
}

.rb-taskrow-meta {
    margin-top: 4px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 13px;
    color: rgba(255,255,255,.65);
}

    .rb-taskrow-meta a {
        color: rgba(255,255,255,.8);
        text-decoration: none;
    }

        .rb-taskrow-meta a:hover {
            text-decoration: underline;
        }

.rb-alertsbtn {
    position: relative;
}

.rb-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    background: rgba(181,124,255,.95);
    color: #0b0b12;
    border: 1px solid rgba(255,255,255,.25);
}

.hidden {
    display: none !important;
}

.rb-alertsmenu {
    position: absolute;
    right: 22px;
    top: 62px;
    width: 360px;
    max-width: calc(100vw - 36px);
    z-index: 9999;
    background: rgba(20, 18, 32, .96);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
    overflow: hidden;
}

.rb-alertsmenu-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

    .rb-alertsmenu-head strong {
        color: rgba(255,255,255,.92);
    }

    .rb-alertsmenu-head button {
        background: transparent;
        border: 0;
        color: rgba(255,255,255,.75);
        cursor: pointer;
        font-weight: 650;
    }

        .rb-alertsmenu-head button:hover {
            color: rgba(255,255,255,.95);
        }

.rb-alert-item {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    cursor: pointer;
}

    .rb-alert-item:last-child {
        border-bottom: 0;
    }

.rb-alert-title {
    font-weight: 700;
    color: rgba(255,255,255,.92);
}

.rb-alert-body {
    margin-top: 4px;
    font-size: 13px;
    color: rgba(255,255,255,.70);
}

.rb-alert-meta {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255,255,255,.55);
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.rb-alert-unread {
    background: rgba(255,255,255,.04);
}

.rb-alert-read {
    opacity: .75;
}

.rb-alert-empty {
    padding: 16px;
    color: rgba(255,255,255,.70);
}
