/**
 * Rock Realty theme — visual language matched to the Dreams Technologies
 * "Property CRM" (Tailwind) template: DM Sans type, green primary
 * (#70bf4c) with navy secondary (#084e7f), light navy-tinted sidebar with
 * dark menu text and solid-green active pills, 56px topbar, #f4f4f4 body.
 */
:root {
    --rr-primary: #70bf4c;
    --rr-primary-dark: #62a842;
    --rr-primary-darker: #4f8f33;
    --rr-primary-soft: #f1f9ed;
    --rr-primary-softer: #f8fcf5;
    /* Darker green for small text sitting on the soft green tint —
       #70bf4c itself is too light to read at badge sizes. */
    --rr-primary-ink: #4f9330;
    /* Raw R,G,B of --rr-primary for rgba() focus rings/shadows, so
       per-user palette overrides (App\Support\ThemePalettes) re-tint
       them too. */
    --rr-primary-rgb: 112, 191, 76;
    --rr-secondary: #084e7f;
    --rr-secondary-soft: #e8eef3;
    --rr-accent: #084e7f;
    --rr-danger: #bf0000;
    --rr-danger-soft: #fdece9;
    --rr-warning: #fdaf22;
    --rr-info: #286ef0;
    --rr-sidebar-bg: #eef3f7; /* template's #084e7f12 tint flattened over white */
    --rr-sidebar-border: #e1e8ee;
    --rr-sidebar-text: #252b32;
    --rr-sidebar-text-dim: #8b95a1;
    --rr-topbar-h: 56px;
    --rr-sidebar-w: 242px;
    --rr-bg: #f4f4f4;
    --rr-card-radius: 10px;
    --rr-card-bg: #ffffff;
    --rr-card-border: #ececec;
    --rr-card-shadow: 0 1px 2px rgba(17, 24, 39, 0.03), 0 4px 12px rgba(17, 24, 39, 0.04);
    --rr-heading: #1a1a1a;
    --rr-muted: #74787f;
    --rr-success: #138743;
}

* { box-sizing: border-box; }

html, body {
    /* Belt-and-suspenders: nothing in this app should ever force page-level
       horizontal scroll on a phone; wide content scrolls inside its own
       .table-responsive/.rr-tabs container instead. */
    overflow-x: hidden;
    max-width: 100%;
}

body {
    background: var(--rr-bg);
    padding-top: var(--rr-topbar-h);
    font-family: "DM Sans", "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--rr-heading);
}

/* ---------- Top loading bar ---------- */
#rr-topline {
    position: fixed;
    top: 0; left: 0; height: 3px; width: 0%;
    background: linear-gradient(90deg, var(--rr-primary), var(--rr-accent));
    z-index: 2000;
    transition: width .25s ease;
}
#rr-topline.rr-loading { animation: rr-topline-run 1s ease-in-out infinite; }
@keyframes rr-topline-run {
    0% { width: 0%; margin-left: 0%; }
    50% { width: 60%; }
    100% { width: 0%; margin-left: 100%; }
}

/* ---------- Topbar ---------- */
.rr-topbar {
    position: fixed;
    top: 0; left: var(--rr-sidebar-w); right: 0;
    height: var(--rr-topbar-h);
    background: #ffffff;
    border-bottom: 1px solid #ececec;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
}
.rr-topbar-left {
    /* Allowed to shrink (and its text to truncate) instead of pushing the
       search/bell/avatar cluster off the right edge on narrow phones. */
    min-width: 0;
    flex: 0 1 auto;
}
.rr-topbar .rr-welcome {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--rr-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.rr-topbar .rr-welcome .rr-welcome-name { color: var(--rr-primary-ink); }
.rr-menu-btn {
    width: 36px; height: 36px;
    flex-shrink: 0;
    border: 1.5px solid #d8dadf;
    border-radius: 8px;
    background: #fff;
    color: #3a3f47;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}
.rr-menu-btn:hover { border-color: var(--rr-primary); color: var(--rr-primary-ink); }

/* ---------- Sidebar backdrop (mobile/tablet off-canvas) ---------- */
.rr-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 30, 46, 0.45);
    z-index: 1035;
    opacity: 0;
    transition: opacity .2s ease;
}
.rr-sidebar-backdrop.show { display: block; opacity: 1; }

.rr-topbar-search { position: relative; width: min(340px, 100%); }
.rr-topbar-search input {
    width: 100%;
    border: 1px solid #e2e4e8;
    border-radius: 8px;
    background: #fff;
    padding: .45rem 2.6rem .45rem 1rem;
    font-size: .9rem;
    color: var(--rr-heading);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.rr-topbar-search input:focus {
    border-color: var(--rr-primary);
    box-shadow: 0 0 0 3px rgba(var(--rr-primary-rgb), 0.15);
}
.rr-topbar-search .bi {
    position: absolute;
    right: 1rem; top: 50%;
    transform: translateY(-50%);
    color: #9aa0a8;
}

.rr-icon-btn {
    position: relative;
    width: 38px; height: 38px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #3a3f47;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.rr-icon-btn:hover { background: #f2f3f5; }
.rr-icon-btn .rr-dot {
    position: absolute;
    top: 7px; right: 8px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--rr-danger);
    border: 1.5px solid #fff;
}
.rr-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--rr-secondary-soft);
    color: var(--rr-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* ---------- Sidebar ---------- */
.rr-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--rr-sidebar-w);
    background: var(--rr-sidebar-bg);
    border-right: 1px solid var(--rr-sidebar-border);
    overflow-y: auto;
    padding: 0 0 1.5rem;
    z-index: 1040;
}
.rr-sidebar::-webkit-scrollbar { width: 6px; }
.rr-sidebar::-webkit-scrollbar-thumb { background: rgba(8, 78, 127, .18); border-radius: 3px; }

.rr-sidebar .rr-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--rr-secondary);
    font-weight: 800;
    font-size: 1.18rem;
    letter-spacing: .04em;
    padding: 1rem 1.25rem .9rem;
}
.rr-sidebar .rr-brand i { font-size: 1.3rem; color: var(--rr-primary); }

.rr-nav-section {
    padding: 1.1rem 1.25rem .45rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--rr-sidebar-text-dim);
}

.rr-sidebar a.rr-nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: .15rem .75rem;
    padding: .55rem .75rem;
    color: var(--rr-sidebar-text);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background .15s, color .15s;
}
.rr-sidebar a.rr-nav-link:hover {
    background: var(--rr-primary);
    color: #fff;
}
.rr-sidebar a.rr-nav-link.active {
    background: var(--rr-primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(var(--rr-primary-rgb), 0.35);
}
.rr-sidebar .rr-nav-link .rr-nav-icon {
    width: 24px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.02rem;
    color: #5d6773;
    transition: color .15s;
}
.rr-sidebar a.rr-nav-link:hover .rr-nav-icon,
.rr-sidebar a.rr-nav-link.active .rr-nav-icon {
    color: #fff;
}
.rr-sidebar .rr-nav-group-toggle { cursor: pointer; }
.rr-sidebar .rr-nav-group-toggle .bi-chevron-down {
    margin-left: auto;
    transition: transform .15s;
    font-size: .72rem;
}
.rr-sidebar .rr-nav-group-toggle[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}
.rr-sidebar .rr-nav-sub a.rr-nav-link {
    margin-left: 1.6rem;
    padding: .4rem .75rem;
    font-size: .84rem;
}
.rr-sidebar .rr-nav-sub a.rr-nav-link .rr-nav-icon {
    width: 20px;
    font-size: .85rem;
}
.rr-sidebar hr {
    border-color: var(--rr-sidebar-border);
    margin: .75rem 1.25rem;
}

/* ---------- Content ---------- */
.rr-content {
    margin-left: var(--rr-sidebar-w);
    padding: 1.5rem;
}

.rr-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: .75rem;
}
.rr-page-header h3 {
    margin: 0;
    font-weight: 700;
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.rr-page-header .d-flex { flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
    border: 1px solid var(--rr-card-border);
    border-radius: var(--rr-card-radius);
    background: var(--rr-card-bg);
    box-shadow: var(--rr-card-shadow);
}
.card .card-title { font-weight: 700; color: var(--rr-heading); }

.rr-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}
.rr-card-head h6 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
}
a.rr-view-all {
    color: var(--rr-primary-ink);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}
a.rr-view-all:hover { text-decoration: underline; }

/* ---------- Master Data hub cards ---------- */
.rr-lookup-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1rem 1.1rem;
    height: 100%;
    background: var(--rr-card-bg);
    border: 1px solid var(--rr-card-border);
    border-radius: var(--rr-card-radius);
    box-shadow: var(--rr-card-shadow);
    text-decoration: none;
    color: var(--rr-heading);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.rr-lookup-card:hover {
    transform: translateY(-2px);
    border-color: var(--rr-primary);
    box-shadow: 0 6px 20px rgba(var(--rr-primary-rgb), 0.18);
    color: var(--rr-heading);
}
.rr-lookup-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--rr-primary-soft);
    color: var(--rr-primary-ink);
    font-size: 1.25rem;
}
.rr-lookup-body {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}
.rr-lookup-title {
    font-weight: 700;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.rr-lookup-count {
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
    padding: .3em .55em;
    border-radius: 999px;
    background: var(--rr-primary-soft);
    color: var(--rr-primary-ink);
}
.rr-lookup-desc {
    font-size: .78rem;
    color: var(--rr-muted);
}
.rr-lookup-arrow {
    margin-left: auto;
    color: var(--rr-muted);
    transition: transform .15s ease, color .15s ease;
}
.rr-lookup-card:hover .rr-lookup-arrow {
    transform: translateX(3px);
    color: var(--rr-primary-ink);
}
.rr-hub-section-title {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--rr-muted);
    margin: 0 0 .65rem .15rem;
}

/* ---------- Wide all-field data tables ---------- */
/* Cells never wrap; the table scrolls horizontally via DataTables scrollX
   while the surrounding toolbar (search/buttons/paging) stays put. */
.rr-table-data th,
.rr-table-data td { 
    white-space: nowrap;
}
.rr-td-clip {
    display: inline-block;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}
/* DataTables' scroll body must never force the page itself wider. */
.dt-scroll-body { max-width: 100%; }

/* ---------- Stat cards ---------- */
.rr-stat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.1rem 1.2rem 1rem;
    border: 1px solid var(--rr-card-border);
    border-radius: var(--rr-card-radius);
    background: var(--rr-card-bg);
    box-shadow: var(--rr-card-shadow);
    transition: transform .18s ease, box-shadow .18s ease;
}
.rr-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.1);
}
.rr-stat-card .rr-stat-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}
.rr-stat-card .rr-stat-label {
    color: #4b5058;
    font-size: .88rem;
    font-weight: 600;
}
.rr-stat-card .rr-stat-icon {
    width: 44px; height: 44px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--rr-primary-soft);
    color: var(--rr-primary-ink);
    font-size: 1.3rem;
}
.rr-stat-card .rr-stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.15;
    margin: .35rem 0 .8rem;
    color: var(--rr-heading);
}
.rr-stat-card .rr-stat-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    font-size: .82rem;
}
.rr-stat-card .rr-stat-delta { color: var(--rr-success); font-weight: 700; }
.rr-stat-card .rr-stat-period { color: var(--rr-muted); }
.rr-stat-card .rr-stat-foot .bi-chevron-right { color: #b3b7bd; }

/* ---------- Quick actions ---------- */
.rr-action-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .8rem .35rem;
    color: var(--rr-heading);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 600;
    border-bottom: 1px solid #f0f1f3;
    transition: background .15s;
    border-radius: 8px;
}
.rr-action-row:last-child { border-bottom: none; }
.rr-action-row:hover { background: var(--rr-primary-softer); color: var(--rr-primary-ink); }
.rr-action-row .rr-action-icon {
    width: 38px; height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--rr-primary-soft);
    color: var(--rr-primary-ink);
    font-size: 1.1rem;
}
.rr-action-row .bi-chevron-right {
    margin-left: auto;
    color: #b3b7bd;
    font-size: .85rem;
}

/* ---------- List rows (visits / enquiries) ---------- */
.rr-list-row {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .75rem 0;
    border-bottom: 1px solid #f0f1f3;
    text-decoration: none;
    color: inherit;
}
.rr-list-row:last-child { border-bottom: none; }
.rr-list-avatar {
    width: 42px; height: 42px;
    flex-shrink: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    background: var(--rr-primary-soft);
    color: var(--rr-primary-ink);
}
.rr-list-avatar.rr-alt-1 { background: var(--rr-secondary-soft); color: var(--rr-secondary); }
.rr-list-avatar.rr-alt-2 { background: #fdefeb; color: #ce4910; }
.rr-list-avatar.rr-alt-3 { background: #e8f0fe; color: var(--rr-info); }
.rr-list-row .rr-list-title {
    font-weight: 700;
    font-size: .92rem;
    color: var(--rr-heading);
}
.rr-list-row .rr-list-sub {
    font-size: .8rem;
    color: var(--rr-muted);
}
.rr-list-row .rr-list-meta {
    margin-left: auto;
    text-align: right;
    font-size: .8rem;
    color: var(--rr-muted);
    white-space: nowrap;
}
.rr-badge-new {
    display: inline-block;
    background: var(--rr-primary-soft);
    color: var(--rr-primary-ink);
    font-size: .72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .15rem .55rem;
}
.rr-badge-available {
    display: inline-block;
    background: #e7f5ec;
    color: var(--rr-success);
    font-size: .72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .15rem .55rem;
}
.rr-badge-unavailable {
    display: inline-block;
    background: var(--rr-danger-soft);
    color: var(--rr-danger);
    font-size: .72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .15rem .55rem;
}

/* ---------- Animations ---------- */
@keyframes rr-fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
.rr-animate {
    opacity: 0;
    animation: rr-fade-up .5s ease forwards;
}
.rr-animate:nth-child(1) { animation-delay: .02s; }
.rr-animate:nth-child(2) { animation-delay: .06s; }
.rr-animate:nth-child(3) { animation-delay: .10s; }
.rr-animate:nth-child(4) { animation-delay: .14s; }
.rr-animate:nth-child(5) { animation-delay: .18s; }
.rr-animate:nth-child(6) { animation-delay: .22s; }
.rr-animate:nth-child(7) { animation-delay: .26s; }
.rr-animate:nth-child(8) { animation-delay: .30s; }
.rr-animate:nth-child(n+9) { animation-delay: .34s; }

/* ---------- Buttons ---------- */
.btn { border-radius: .5rem; font-weight: 600; }
.btn-primary {
    background: var(--rr-primary);
    border-color: var(--rr-primary);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: var(--rr-primary-dark) !important;
    border-color: var(--rr-primary-dark) !important;
}
.btn-outline-primary {
    color: var(--rr-primary-ink);
    border-color: var(--rr-primary);
}
.btn-outline-primary:hover, .btn-outline-primary:active {
    background: var(--rr-primary) !important;
    border-color: var(--rr-primary) !important;
    color: #fff !important;
}

.text-primary { color: var(--rr-primary-ink) !important; }
.bg-primary { background-color: var(--rr-primary) !important; }
a { color: var(--rr-primary-ink); }
.form-control:focus, .form-select:focus {
    border-color: var(--rr-primary);
    box-shadow: 0 0 0 .2rem rgba(var(--rr-primary-rgb), .18);
}
.nav-pills .nav-link.active { background-color: var(--rr-primary); }
.page-link { color: var(--rr-primary-ink); }
.page-item.active .page-link {
    background-color: var(--rr-primary);
    border-color: var(--rr-primary);
}

/* ---------- Index pages: filter card ---------- */
#rr-filter-panel .card { border: 1px solid var(--rr-card-border); }
#rr-filter-panel .form-label {
    font-weight: 600;
    font-size: .88rem;
    color: var(--rr-heading);
}
#rr-filter-panel .form-select,
#rr-filter-panel .form-control {
    border-radius: 8px;
    padding: .55rem .85rem;
    color: #5a5f66;
}
#rr-filter-panel .btn { min-width: 92px; }

/* ---------- Index pages: summary chips ---------- */
.rr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: 1rem;
}
.rr-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: var(--rr-primary-soft);
    color: var(--rr-primary-ink);
    font-size: .85rem;
    font-weight: 700;
    border-radius: 8px;
    padding: .45rem .9rem;
}

/* ---------- Index pages: table ---------- */
table.dataTable thead th {
    background: #f7f8f9 !important;
    color: #6b7080;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: none !important;
    padding-top: .85rem;
    padding-bottom: .85rem;
    white-space: nowrap;
}
table.dataTable tbody td {
    padding-top: .85rem;
    padding-bottom: .85rem;
    color: #3a3f47;
    font-size: .9rem;
    vertical-align: middle;
}
table.dataTable tbody tr:hover td { background: var(--rr-primary-softer); }
table.dataTable img.rounded { border-radius: 8px !important; }

/* Boxed grid: every cell gets a column + row line. DataTables forces
   border-collapse: separate, so each cell draws only its right/bottom edge
   and the first column / header row add the left/top edge (no doubled lines).
   With scrollX the header lives in its own table, hence the scroll-body
   exclusions for the hidden sizing header. */
table.dataTable > thead > tr > th,
table.dataTable > tbody > tr > td {
    border-right: 1px solid var(--rr-grid-line, #dee2e6) !important;
    border-bottom: 1px solid var(--rr-grid-line, #dee2e6) !important;
}
table.dataTable > thead > tr > th:first-child,
table.dataTable > tbody > tr > td:first-child {
    border-left: 1px solid var(--rr-grid-line, #dee2e6) !important;
}
table.dataTable > thead > tr > th {
    border-top: 1px solid var(--rr-grid-line, #dee2e6) !important;
}
/* DataTables right-aligns columns it detects as numeric (rent, phone
   numbers, S.No); keep everything left-aligned like the legacy app. */
table.dataTable th.dt-type-numeric,
table.dataTable td.dt-type-numeric,
table.dataTable th.dt-type-date,
table.dataTable td.dt-type-date {
    text-align: left;
}
table.dataTable th.dt-type-numeric div.dt-column-header,
table.dataTable th.dt-type-date div.dt-column-header {
    flex-direction: row;
}
div.dt-scroll-body > table.dataTable > thead > tr > th {
    border-top-width: 0 !important;
    border-bottom-width: 0 !important;
}

/* Status badges rendered by rr-datatable.js */
.rr-td-badge {
    display: inline-block;
    font-size: .78rem;
    font-weight: 600;
    border-radius: 999px;
    padding: .3rem .8rem;
    white-space: nowrap;
}
.rr-td-badge.rr-td-green { background: #e7f5ec; color: var(--rr-success); }
.rr-td-badge.rr-td-red { background: var(--rr-danger-soft); color: var(--rr-danger); }
.rr-td-badge.rr-td-gray { background: #eef0f2; color: #5a5f66; }

/* Row action buttons -> plain gray icons like the reference design */
table.dataTable .btn.btn-sm.btn-outline-secondary,
table.dataTable .btn.btn-sm.btn-outline-primary,
table.dataTable .btn.btn-sm.btn-outline-danger {
    border: none;
    background: transparent;
    color: #7a7f87;
    padding: .3rem .45rem;
    font-size: 1.05rem;
    line-height: 1;
}
table.dataTable .btn.btn-sm.btn-outline-secondary:hover,
table.dataTable .btn.btn-sm.btn-outline-primary:hover {
    color: var(--rr-primary-ink);
    background: var(--rr-primary-soft);
}
table.dataTable .btn.btn-sm.btn-outline-danger:hover {
    color: var(--rr-danger);
    background: var(--rr-danger-soft);
}
table.dataTable .btn.btn-sm.btn-success {
    background: var(--rr-success);
    border: none;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    padding: .3rem .8rem;
}

/* DataTables search input, squared like the template's inputs */
.dt-search { display: flex; align-items: center; gap: .4rem; }
.dt-search label { display: none; }
.dt-search input.form-control,
.dt-search input {
    border: 1px solid #e2e4e8 !important;
    border-radius: 8px !important;
    padding: .5rem 1rem !important;
    min-width: 220px;
    font-size: .9rem;
}
.dt-search input:focus {
    border-color: var(--rr-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--rr-primary-rgb), 0.15) !important;
    outline: none;
}

/* ---------- Show pages ---------- */
.rr-show-header {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 1.25rem;
}
.rr-show-header h3 { margin: 0; font-weight: 800; }
.rr-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 8px;
    color: var(--rr-heading);
    font-size: 1.25rem;
    text-decoration: none;
}
.rr-back-btn:hover { background: var(--rr-primary-soft); color: var(--rr-primary-ink); }

/* Hero card */
.rr-hero .card-body {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: stretch;
}
.rr-hero-media {
    position: relative;
    width: 250px;
    min-height: 165px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #f2f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b3b7bd;
    font-size: 3rem;
}
.rr-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}
.rr-hero-media .rr-hero-badge {
    position: absolute;
    top: 10px; left: 10px;
    z-index: 1;
}
.rr-hero-facts {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1.25rem 1.5rem;
    align-content: center;
}
.rr-fact .rr-fact-label {
    color: var(--rr-muted);
    font-size: .84rem;
    margin-bottom: .25rem;
}
.rr-fact .rr-fact-value {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--rr-heading);
    word-break: break-word;
}

/* Tab bar */
.rr-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: .35rem;
    padding-bottom: .25rem;
    border-bottom: 1px solid #f0f1f3;
    margin-bottom: 1rem;
}
.rr-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: #5a5f66;
    font-weight: 600;
    font-size: .92rem;
    border-radius: 8px;
    padding: .55rem 1rem;
    white-space: nowrap;
}
.rr-tabs .nav-link:hover { color: var(--rr-primary-ink); background: var(--rr-primary-soft); }
.rr-tabs .nav-link.active {
    background: var(--rr-primary);
    color: #fff;
}

/* Show-page detail table: single "Label : Value" list, no tabs */
.rr-detail-table { font-size: .9rem; }
.rr-detail-table > tbody > tr > * {
    padding: .6rem .5rem;
    border-bottom: 1px solid #eceef1;
    vertical-align: top;
    background: transparent;
}
.rr-detail-table > tbody > tr:first-child > * { border-top: 1px solid #eceef1; }
.rr-detail-table .rr-dt-label {
    width: 220px;
    font-weight: 600;
    color: var(--rr-heading);
    white-space: nowrap;
}
.rr-detail-table .rr-dt-sep {
    width: 24px;
    color: var(--rr-muted);
    text-align: center;
}
.rr-detail-table .rr-dt-value {
    color: #4b5058;
    word-break: break-word;
}

/* Child-record blocks under the detail table (payments, follow-ups, media) */
.rr-detail-section {
    border: 1px solid #eceef1;
    border-radius: 6px;
    height: 100%;
    overflow: hidden;
}
.rr-detail-section-title {
    padding: .6rem .75rem;
    font-weight: 600;
    font-size: .9rem;
    color: var(--rr-primary-ink);
    border-bottom: 1px solid #eceef1;
}
.rr-detail-section > :not(.rr-detail-section-title):not(.table-responsive) { margin: .75rem; }
.rr-sub-table { font-size: .85rem; margin-bottom: 0; }
.rr-sub-table > :not(caption) > * > * {
    padding: .5rem .75rem;
    border: 1px solid #eceef1;
}
.rr-sub-table > thead > tr > th { font-weight: 600; color: var(--rr-heading); white-space: nowrap; }
.rr-sub-table tr > :first-child { border-left: 0; }
.rr-sub-table tr > :last-child { border-right: 0; }
.rr-sub-table > tbody > tr:last-child > * { border-bottom: 0; }

@media (max-width: 575.98px) {
    .rr-detail-table .rr-dt-label { width: auto; white-space: normal; }
    .rr-hero-media { width: 100%; }
}

/* ---------- Toastr notifications ---------- */
#toast-container > div {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.2) !important;
    opacity: 1;
    padding: 15px 15px 15px 50px;
    font-family: inherit;
}
#toast-container > .toast-success { background-color: var(--rr-success); }
#toast-container > .toast-error { background-color: var(--rr-danger); }
#toast-container > .toast-warning { background-color: #e07c00; }
#toast-container > .toast-info { background-color: var(--rr-info); }
#toast-container .toast-progress { opacity: .35; }

/* ---------- DataTables export buttons ---------- */
/* Soft theme-colored buttons, forced over whatever classes the buttons
   integration stacks on them. */
.dt-buttons .btn {
    background: var(--rr-primary-soft) !important;
    border: none !important;
    color: var(--rr-primary-ink) !important;
    border-radius: 8px !important;
    font-size: .84rem;
    font-weight: 600;
    padding: .5rem .85rem;
    box-shadow: none !important;
}
.dt-buttons .btn:hover, .dt-buttons .btn:focus, .dt-buttons .btn.active {
    background: var(--rr-primary) !important;
    color: #fff !important;
}
/* When relocated into the page header, sit inline with the action buttons */
.rr-header-export { display: inline-flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- Row select checkboxes ---------- */
input[type="checkbox"] { accent-color: var(--rr-primary); }
table.dataTable .rr-select-col,
table.dataTable thead th.rr-select-col { width: 34px; text-align: center; }
table.dataTable input.dt-select-checkbox { width: 16px; height: 16px; cursor: pointer; }
table.dataTable thead input.dt-select-checkbox { width: 16px; height: 16px; cursor: pointer; }
/* !important on color: the bundled DataTables Select stylesheet sets
   selected-row text to white for its own blue highlight, at higher CSS
   specificity than a plain "tr.selected td" selector - without !important
   that white wins here too, making text invisible against our lighter
   highlight. */
table.dataTable tbody tr.selected td,
table.dataTable tbody tr.selected a {
    background: var(--rr-primary-soft) !important;
    box-shadow: none !important;
    color: var(--rr-body-color, #212529) !important;
}

/* ---------- Image hover-zoom popup ---------- */
#rr-img-preview {
    position: fixed;
    z-index: 3000;
    pointer-events: none;
    opacity: 0;
    transform: scale(.85);
    transition: opacity .15s ease, transform .15s ease;
    background: #fff;
    padding: 6px;
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(17, 24, 39, .3);
}
#rr-img-preview.show { opacity: 1; transform: scale(1); }
#rr-img-preview img {
    display: block;
    max-width: 340px;
    max-height: 280px;
    border-radius: 8px;
    object-fit: contain;
}
.rr-content img { cursor: zoom-in; }
.rr-content .rr-hero-media img,
.rr-content audio + img { cursor: default; }

/* ---------- Footer ---------- */
.rr-footer {
    margin-left: var(--rr-sidebar-w);
    padding: 1.1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .4rem;
    font-size: .82rem;
    color: var(--rr-muted);
    border-top: 1px solid #ececec;
}
.rr-footer strong { color: var(--rr-heading); }
.rr-footer .rr-footer-dot { color: #d8dadf; }

@media (max-width: 991.98px) {
    .rr-footer { margin-left: 0; }
}

/* ---------- Notification bell dropdown ---------- */
.rr-notif-menu {
    width: 340px;
    max-width: 90vw;
    padding: 0;
    border: 1px solid var(--rr-card-border);
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(17, 24, 39, 0.16);
    overflow: hidden;
}
.rr-notif-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1rem;
    font-weight: 700;
    border-bottom: 1px solid #f0f1f3;
}
.rr-notif-menu-head a { font-size: .82rem; font-weight: 600; }
#rr-notif-list { max-height: 360px; overflow-y: auto; }
.rr-notif-item {
    display: block;
    padding: .75rem 1rem;
    border-bottom: 1px solid #f0f1f3;
    text-decoration: none;
    color: inherit;
}
.rr-notif-item:last-child { border-bottom: none; }
.rr-notif-item:hover { background: var(--rr-primary-softer); }
.rr-notif-item.rr-notif-unread { background: var(--rr-primary-softer); }
.rr-notif-item-title { font-weight: 700; font-size: .9rem; color: var(--rr-heading); }
.rr-notif-item-msg {
    font-size: .82rem;
    color: var(--rr-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rr-notif-item-time { font-size: .74rem; color: #b3b7bd; margin-top: .15rem; }

.rr-list-row.rr-notif-unread { background: var(--rr-primary-softer); border-radius: 8px; padding-left: .5rem; padding-right: .5rem; }

/* ---------- Gallery category cards ---------- */
.rr-gallery-head {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid #f0f1f3;
    margin-bottom: .35rem;
}
.rr-gallery-icon {
    width: 48px; height: 48px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--rr-primary-soft);
    color: var(--rr-primary-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.rr-gallery-title { font-weight: 800; font-size: 1.15rem; line-height: 1.25; }
.rr-gallery-sub { color: var(--rr-muted); font-size: .84rem; }
.rr-gallery-total {
    margin-left: auto;
    font-weight: 700;
    font-size: .88rem;
    color: var(--rr-heading);
    white-space: nowrap;
}
.rr-gallery-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .8rem .25rem;
    border-bottom: 1px solid #f0f1f3;
    text-decoration: none;
    color: var(--rr-heading);
    border-radius: 8px;
    transition: background .15s;
}
.rr-gallery-row:last-child { border-bottom: none; }
.rr-gallery-row:hover { background: var(--rr-primary-softer); color: var(--rr-primary-ink); }
.rr-gallery-label { font-weight: 700; font-size: .95rem; }
.rr-gallery-count {
    margin-left: auto;
    background: var(--rr-primary-softer);
    border: 1px solid rgba(var(--rr-primary-rgb), .18);
    color: var(--rr-heading);
    font-weight: 700;
    font-size: .84rem;
    border-radius: 8px;
    padding: .25rem .7rem;
    min-width: 48px;
    text-align: center;
}
.rr-gallery-row .bi-chevron-right { color: #b3b7bd; font-size: .85rem; }

/* ---------- Permission matrix ---------- */
.rr-perm-table thead th {
    background: #f7f8f9;
    color: #6b7080;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: none;
    padding: .85rem .75rem;
    white-space: nowrap;
}
.rr-perm-table tbody td {
    border-color: #f0f1f3;
    padding: .8rem .75rem;
}
.rr-perm-table .rr-perm-module { font-weight: 600; white-space: nowrap; }
.rr-perm-table .form-check-input {
    width: 17px; height: 17px;
    cursor: pointer;
    border-color: #c8ccd2;
}
.rr-perm-table .form-check-input:checked,
.form-check-input:checked {
    background-color: var(--rr-primary);
    border-color: var(--rr-primary);
}
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(var(--rr-primary-rgb), .18); }

/* ---------- Confirm dialog ---------- */
.rr-confirm-dialog { max-width: 400px; }
.rr-confirm-content {
    border: none;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(17, 24, 39, 0.25);
}
.rr-confirm-content .modal-body { padding: 2rem 1.75rem 1.5rem; }
.rr-confirm-icon {
    width: 64px; height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--rr-primary-soft);
    color: var(--rr-primary-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}
.rr-confirm-title { font-weight: 800; margin-bottom: .35rem; }
.rr-confirm-message { color: var(--rr-muted); margin-bottom: 0; }
.rr-confirm-content .btn { min-width: 104px; border-radius: 8px; }
.rr-confirm-input { margin-top: 1rem; border-radius: 8px; }

/* ---------- Transfer account page ---------- */
.rr-transfer-grid {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: .75rem 0 1.25rem;
}
.rr-transfer-tile {
    flex: 1;
    min-width: 230px;
    max-width: 330px;
    border: 1px solid var(--rr-card-border);
    border-radius: 10px;
    padding: 1.5rem 1.25rem;
    text-align: center;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.rr-transfer-tile.rr-transfer-target { border-style: dashed; }
.rr-transfer-tile.rr-transfer-target.rr-selected {
    border-style: solid;
    border-color: var(--rr-primary);
    box-shadow: 0 0 0 3px rgba(var(--rr-primary-rgb), 0.15);
}
.rr-transfer-avatar {
    width: 64px; height: 64px;
    margin: 0 auto .75rem;
    border-radius: 50%;
    background: var(--rr-primary-soft);
    color: var(--rr-primary-ink);
    font-weight: 800;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rr-transfer-tile .rr-transfer-name { font-weight: 800; font-size: 1.05rem; }
.rr-transfer-tile .rr-transfer-role { color: var(--rr-muted); font-size: .84rem; margin-bottom: .6rem; }
.rr-transfer-count {
    display: inline-block;
    background: var(--rr-primary-soft);
    color: var(--rr-primary-ink);
    font-weight: 700;
    font-size: .84rem;
    border-radius: 999px;
    padding: .3rem .85rem;
}
.rr-transfer-arrow {
    display: flex;
    align-items: center;
    align-self: center;
    color: var(--rr-primary);
    font-size: 1.7rem;
}
.rr-transfer-arrow i {
    opacity: .2;
    animation: rr-arrow-flow 1.4s ease-in-out infinite;
}
.rr-transfer-arrow i:nth-child(2) { animation-delay: .18s; }
.rr-transfer-arrow i:nth-child(3) { animation-delay: .36s; }
@keyframes rr-arrow-flow {
    0%, 100% { opacity: .2; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(5px); }
}
.rr-transferring .rr-transfer-arrow i { animation-duration: .55s; }
.rr-transferring .rr-transfer-tile { opacity: .75; }

@media (max-width: 767.98px) {
    .rr-transfer-arrow { transform: rotate(90deg); margin: -0.5rem 0; }
}

/* ---------- DataTables processing spinner ---------- */
.dataTables_processing {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.dataTables_processing::after {
    content: "";
    display: inline-block;
    width: 28px; height: 28px;
    border: 3px solid rgba(var(--rr-primary-rgb), .25);
    border-top-color: var(--rr-primary);
    border-radius: 50%;
    animation: rr-spin .7s linear infinite;
}
@keyframes rr-spin { to { transform: rotate(360deg); } }

table.dataTable {
    background: transparent;
}

/* ---------- DataTables layout (buttons/search/paging toolbar) ---------- */
.dt-layout-row {
    align-items: center;
    margin-bottom: .75rem;
}
.dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.dt-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.dt-search input {
    border-radius: .5rem;
}
.dt-paging .paginate_button.page-item .page-link {
    border-radius: .5rem;
    margin: 0 .15rem;
    border: none;
    color: #5a5f66;
    font-size: .88rem;
    min-width: 34px;
    text-align: center;
}
.dt-paging .paginate_button.page-item.active .page-link {
    background: var(--rr-primary);
    color: #fff;
}
.dt-paging .paginate_button.page-item:not(.active) .page-link:hover {
    background: var(--rr-primary-soft);
    color: var(--rr-primary-ink);
}
.dt-info { color: var(--rr-muted); font-size: .85rem; }
div.dt-container div.dt-layout-table {
    margin-bottom: .5rem;
}

@media (max-width: 991.98px) {
    :root { --rr-sidebar-w: 0px; }
    .rr-sidebar {
        transform: translateX(-100%);
        transition: transform .2s;
        width: min(256px, 82vw);
    }
    .rr-sidebar.show { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.35); }
    .rr-topbar { left: 0; padding: 0 1rem; }
    .rr-topbar .rr-welcome { font-size: 1rem; }
    .rr-topbar-search { display: none; }
    .rr-content { margin-left: 0; padding: 1rem; }

    /* DataTables' search box would otherwise force a fixed 220px minimum
       width, overflowing the row next to the export/filter buttons. */
    .dt-search input.form-control,
    .dt-search input {
        min-width: 0;
        width: 100%;
    }
    .dt-layout-row .dt-layout-end { width: 100%; margin-top: .5rem; }

    .rr-transfer-grid { flex-direction: column; }
    .rr-transfer-tile { width: 100%; max-width: none; }
}

@media (max-width: 575.98px) {
    .rr-topbar { padding: 0 .75rem; gap: .5rem; }
    .rr-topbar .rr-welcome { font-size: .95rem; }
    .rr-icon-btn { width: 36px; height: 36px; font-size: 1.1rem; }
    .rr-avatar { width: 34px; height: 34px; font-size: 1.15rem; }
    .rr-content { padding: .75rem; }
    .rr-page-header h3 { font-size: 1.02rem; }
    .rr-hero .card-body { padding: 1rem; }
    .rr-stat-card .rr-stat-value { font-size: 1.55rem; }
}

/* ---------- Module KPI stat cards (soft tinted, icon chip right) ---------- */
.rr-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.rr-kpi-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1.05rem 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .65);
    box-shadow: var(--rr-card-shadow);
    min-width: 0;
}
.rr-kpi-info { min-width: 0; }
.rr-kpi-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    margin-bottom: .3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rr-kpi-value {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--rr-heading);
}
.rr-kpi-icon {
    width: 46px; height: 46px;
    flex-shrink: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.rr-kpi-blue   { background: linear-gradient(120deg, #dbe7f1 0%, #f6f9fb 85%); }
.rr-kpi-blue   .rr-kpi-label { color: #6b87a3; }
.rr-kpi-blue   .rr-kpi-icon { background: #c7dcee; color: #2f6fa8; }
.rr-kpi-green  { background: linear-gradient(120deg, #ddf2dc 0%, #f7fbf5 85%); }
.rr-kpi-green  .rr-kpi-label { color: #6ba367; }
.rr-kpi-green  .rr-kpi-icon { background: #c9e9c6; color: #138743; }
.rr-kpi-teal   { background: linear-gradient(120deg, #d7eeea 0%, #f5faf9 85%); }
.rr-kpi-teal   .rr-kpi-label { color: #5f9c92; }
.rr-kpi-teal   .rr-kpi-icon { background: #c2e5df; color: #008071; }
.rr-kpi-amber  { background: linear-gradient(120deg, #f7ecd6 0%, #fdf9f0 85%); }
.rr-kpi-amber  .rr-kpi-label { color: #b9924a; }
.rr-kpi-amber  .rr-kpi-icon { background: #f3dfb6; color: #d3921f; }
.rr-kpi-red    { background: linear-gradient(120deg, #f8e2e0 0%, #fdf6f5 85%); }
.rr-kpi-red    .rr-kpi-label { color: #b06a63; }
.rr-kpi-red    .rr-kpi-icon { background: #f2cfcb; color: #bf3f34; }
.rr-kpi-purple { background: linear-gradient(120deg, #eae2f6 0%, #faf7fe 85%); }
.rr-kpi-purple .rr-kpi-label { color: #8b74ad; }
.rr-kpi-purple .rr-kpi-icon { background: #ddccf1; color: #6d3fc0; }

/* ---------- Quick actions (permission-checked links to related modules) ---------- */
.rr-quick-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
}
.rr-quick-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--rr-muted);
    margin-right: .25rem;
}
.rr-quick-label .bi { color: var(--rr-warning); }
.rr-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #fff;
    border: 1px solid var(--rr-card-border);
    border-radius: 999px;
    padding: .4rem .9rem;
    font-size: .84rem;
    font-weight: 600;
    color: var(--rr-heading);
    text-decoration: none;
    box-shadow: var(--rr-card-shadow);
    transition: border-color .15s, color .15s, transform .15s;
}
.rr-quick-btn .bi { color: var(--rr-primary-ink); }
.rr-quick-btn:hover {
    border-color: var(--rr-primary);
    color: var(--rr-primary-ink);
    transform: translateY(-1px);
}

/* ---------- Grid/List view toggle + property card grid ---------- */
/* The toggle sits in the DataTables toolbar next to the search box. */
.dt-layout-cell.dt-layout-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
}
.rr-view-toggle {
    display: inline-flex;
    flex-shrink: 0;
    border: 1px solid #e2e4e8;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.rr-view-btn {
    border: none;
    background: transparent;
    color: #7a7f87;
    width: 38px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background .15s, color .15s;
}
.rr-view-btn + .rr-view-btn { border-left: 1px solid #e2e4e8; }
.rr-view-btn:hover { color: var(--rr-primary-ink); background: var(--rr-primary-soft); }
.rr-view-btn.active { background: var(--rr-primary); color: #fff; }

/* Grid mode hides the table (toolbar, info and paging stay in place). */
.dt-container.rr-grid-mode div.dt-layout-table { display: none !important; }

.rr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: .75rem;
}
.rr-grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 0;
}
.rr-grid-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--rr-card-border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
}
.rr-grid-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.1);
}
.rr-grid-media {
    position: relative;
    height: 180px;
    background: #f2f3f5;
}
.rr-grid-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}
.rr-grid-media-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c3c8cf;
    font-size: 2.6rem;
}
.rr-grid-badges {
    position: absolute;
    left: 10px;
    bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    z-index: 1;
}
.rr-grid-chip {
    display: inline-block;
    background: rgba(17, 24, 39, .78);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    border-radius: 6px;
    padding: .22rem .55rem;
    white-space: nowrap;
}
/* Status pills reuse .rr-td-badge colors but need to read over photos. */
.rr-grid-badges .rr-td-badge {
    font-size: .72rem;
    padding: .22rem .6rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.rr-grid-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: .35rem;
    z-index: 1;
}
.rr-grid-actions .btn,
.rr-grid-actions form { margin: 0; }
.rr-grid-actions .btn.btn-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #3a3f47;
    font-size: .95rem;
    box-shadow: 0 2px 8px rgba(17, 24, 39, .18);
}
.rr-grid-actions .btn.btn-sm:hover { background: var(--rr-primary); color: #fff; }
.rr-grid-actions .btn.btn-sm.btn-outline-danger:hover { background: var(--rr-danger); color: #fff; }
.rr-grid-body {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: .85rem 1rem 1rem;
}
.rr-grid-title {
    font-weight: 700;
    font-size: .98rem;
    color: var(--rr-heading);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rr-grid-sub {
    font-size: .82rem;
    color: var(--rr-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rr-grid-sub .bi { font-size: .8rem; }
.rr-grid-price {
    font-weight: 800;
    font-size: 1.12rem;
    color: var(--rr-heading);
    margin-top: .1rem;
}
.rr-grid-specs {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .45rem;
}
.rr-grid-spec {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    border: 1px solid #eceef0;
    border-radius: 6px;
    padding: .25rem .5rem;
    font-size: .76rem;
    font-weight: 600;
    color: #4b5058;
    white-space: nowrap;
}
.rr-grid-spec .bi { color: var(--rr-muted); }

/* ---------- Settings: per-user color palette picker ---------- */
.rr-palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: .75rem;
}
.rr-palette-option { position: relative; }
.rr-palette-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.rr-palette-option label {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    padding: .75rem .85rem;
    border: 2px solid var(--rr-card-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.rr-palette-option label:hover { transform: translateY(-1px); border-color: #c9cdd3; }
.rr-palette-option input:checked + label {
    border-color: var(--rr-palette-primary, var(--rr-primary));
    box-shadow: 0 4px 14px rgba(17, 24, 39, .08);
}
.rr-palette-swatch {
    position: relative;
    width: 34px; height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--rr-palette-primary);
}
.rr-palette-swatch::after {
    content: "";
    position: absolute;
    right: -3px; bottom: -3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--rr-palette-secondary);
}
.rr-palette-name {
    font-size: .88rem;
    font-weight: 600;
    color: var(--rr-heading);
}
.rr-palette-option input:checked + label .rr-palette-check { opacity: 1; }
.rr-palette-check {
    margin-left: auto;
    opacity: 0;
    color: var(--rr-palette-primary, var(--rr-primary));
    font-size: 1.1rem;
    transition: opacity .15s;
}
