/* =====================================================================
   RacioFlow — Unified interface layer
   Precision operations cockpit · authoritative visual layer
   ================================================================== */

:root {
    --radius-xs: 3px;
    --radius-sm: 6px;
    --radius: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-pill: 999px;
    --background: #f4f5f7;
    --surface: #ffffff;
    --surface-secondary: #f8f8f9;
    --surface-hover: #f1f2f4;
    --surface-sunken: #e9eaed;
    --text-primary: #19191c;
    --text-secondary: #505159;
    --text-muted: #656771;
    --border-color: #dedfe3;
    --border-strong: #c9cbd1;
    --sidebar-expanded-width: 224px;
    --sidebar-compact-width: 68px;
    --sidebar-width: var(--sidebar-expanded-width);
    --sidebar-gap: 10px;
    --topbar-height: 64px;
    --interface-max: 1540px;
    --interface-gutter: clamp(1rem, 2.2vw, 2rem);
    --interface-panel: #ffffff;
    --interface-panel-muted: #f8f8f9;
    --interface-line: #dedfe3;
    --interface-line-strong: #c9cbd1;
    --interface-ring: rgba(229, 3, 5, .14);
    --interface-red-shadow: 0 8px 20px rgba(185, 2, 4, .17);
    --interface-panel-shadow: 0 1px 2px rgba(17, 17, 20, .04), 0 8px 24px rgba(17, 17, 20, .045);
    --interface-float-shadow: 0 18px 46px rgba(17, 17, 20, .14);
}

:root[data-theme="dark"] {
    --background: #0f1012;
    --surface: #18191c;
    --surface-secondary: #1d1e22;
    --surface-hover: #25262b;
    --surface-sunken: #111214;
    --text-primary: #f7f7f8;
    --text-secondary: #c1c2c8;
    --text-muted: #a0a1aa;
    --border-color: #303137;
    --border-strong: #46474f;
    --interface-panel: #18191c;
    --interface-panel-muted: #1d1e22;
    --interface-line: #303137;
    --interface-line-strong: #46474f;
    --interface-ring: rgba(255, 90, 92, .2);
    --interface-red-shadow: 0 8px 22px rgba(229, 3, 5, .18);
    --interface-panel-shadow: 0 1px 2px rgba(0, 0, 0, .32), 0 10px 26px rgba(0, 0, 0, .2);
    --interface-float-shadow: 0 20px 50px rgba(0, 0, 0, .44);
}

html { background: var(--background); }

body {
    color: var(--text-primary);
    background: var(--background);
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

button,
[role="button"],
summary,
select,
label[for],
a { -webkit-tap-highlight-color: transparent; }

button,
[role="button"],
summary,
select,
input[type="checkbox"],
input[type="radio"] { cursor: pointer; }

::selection {
    background: var(--primary);
    color: var(--primary-contrast);
}

* { scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: var(--radius-pill);
    background: var(--border-strong);
    background-clip: padding-box;
}

/* ---------------------------------------------------------------------
   Application shell
   ------------------------------------------------------------------ */

.rf-shell-page .rf-app {
    background:
        radial-gradient(circle at 92% 2%, rgba(229, 3, 5, .045), transparent 24rem),
        var(--background);
}

:root[data-theme="dark"] .rf-shell-page .rf-app {
    background:
        radial-gradient(circle at 92% 2%, rgba(229, 3, 5, .075), transparent 26rem),
        var(--background);
}

.rf-sidebar {
    inset: var(--sidebar-gap) auto var(--sidebar-gap) var(--sidebar-gap);
    width: var(--sidebar-width);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 20px;
    background:
        radial-gradient(circle at 14% -4%, rgba(239, 34, 38, .28), transparent 14rem),
        radial-gradient(circle at 108% 52%, rgba(151, 151, 160, .1), transparent 15rem),
        linear-gradient(155deg, #202126 0%, #131419 36%, #090a0d 100%);
    box-shadow:
        0 20px 52px rgba(5, 5, 7, .28),
        0 4px 12px rgba(5, 5, 7, .18),
        inset 0 1px 0 rgba(255, 255, 255, .075);
    backdrop-filter: none;
    transition: transform var(--transition), box-shadow var(--transition);
}

.rf-sidebar::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: inherit;
    background-image:
        linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
    background-size: 24px 24px;
    content: "";
    opacity: .46;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 72%);
    mask-image: linear-gradient(180deg, #000, transparent 72%);
}

.rf-sidebar::after {
    inset: 18px 0 18px auto;
    width: 3px;
    height: auto;
    border-radius: var(--radius-pill) 0 0 var(--radius-pill);
    background: linear-gradient(180deg, transparent 2%, #ff4b4e 20%, var(--primary) 52%, transparent 88%);
    box-shadow: 0 0 22px rgba(229, 3, 5, .42);
}

.rf-sidebar-decor {
    position: absolute;
    z-index: 0;
    inset: 0;
    display: block;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
}

.rf-sidebar-decor::before {
    position: absolute;
    top: 14%;
    right: -52px;
    width: 126px;
    height: 126px;
    border: 24px solid rgba(255, 255, 255, .018);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .045), 0 0 42px rgba(229, 3, 5, .08);
    content: "";
}

.rf-sidebar-decor::after {
    position: absolute;
    right: -48px;
    bottom: 9%;
    width: 116px;
    height: 116px;
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(229, 3, 5, .1), rgba(255, 255, 255, .018));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055), 0 22px 50px rgba(0, 0, 0, .24);
    content: "";
    transform: rotate(34deg);
}

.rf-sidebar-shape { position: absolute; display: block; }

.rf-sidebar-shape.is-ring {
    top: 24%;
    left: -37px;
    width: 74px;
    height: 74px;
    border: 1px solid rgba(239, 34, 38, .22);
    border-radius: 50%;
    box-shadow: inset 0 0 28px rgba(229, 3, 5, .08), 0 0 28px rgba(229, 3, 5, .06);
}

.rf-sidebar-shape.is-diamond {
    top: 54%;
    right: -31px;
    width: 64px;
    height: 64px;
    border: 1px solid rgba(255, 255, 255, .055);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .006));
    transform: rotate(42deg);
}

.rf-sidebar-shape.is-dots {
    bottom: 25%;
    left: 18px;
    width: 88px;
    height: 104px;
    background-image: radial-gradient(circle, rgba(239, 34, 38, .24) 1.15px, transparent 1.35px);
    background-size: 12px 12px;
    opacity: .56;
    -webkit-mask-image: linear-gradient(140deg, transparent, #000 30%, transparent 94%);
    mask-image: linear-gradient(140deg, transparent, #000 30%, transparent 94%);
}

.rf-sidebar-head,
.rf-sidebar-search-panel,
.rf-sidebar-nav,
.rf-sidebar-foot {
    position: relative;
    z-index: 1;
}

.rf-sidebar-head {
    display: flex;
    min-height: 72px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
    background: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent);
}

.rf-sidebar-brand {
    min-width: 0;
    min-height: 0;
    flex: 1;
    padding: .75rem 2.5rem .75rem .75rem;
    border: 0;
    background: transparent;
}

.rf-sidebar-logo-tile {
    display: grid;
    width: 38px;
    height: 38px;
    flex: none;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .3), 0 0 0 3px rgba(229, 3, 5, .09);
}

.rf-sidebar-brand img {
    width: 26px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    object-fit: contain;
}

.rf-sidebar-brand .rf-brand-name {
    color: #fff;
    font-size: .9rem;
    font-weight: 730;
    letter-spacing: -.025em;
}

.rf-sidebar-brand .rf-brand-sub {
    display: block;
    max-width: 108px;
    margin-top: .2rem;
    color: #a6a6aa;
    font-size: .54rem;
    letter-spacing: .075em;
}

.rf-sidebar-collapse {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: .62rem;
    display: grid;
    width: 32px;
    height: 32px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 102, 105, .34);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(239, 34, 38, .92), rgba(174, 0, 3, .92));
    box-shadow: 0 8px 18px rgba(118, 0, 2, .28), inset 0 1px 0 rgba(255, 255, 255, .2);
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.rf-sidebar-collapse::before,
.rf-sidebar-search-clear::before,
.rf-sidebar-signout::before {
    content: "";
    position: absolute;
    inset: -6px;
}

.rf-sidebar-collapse:hover {
    border-color: rgba(255, 158, 160, .68);
    background: linear-gradient(145deg, #ff3539, #c00004);
    box-shadow: 0 10px 24px rgba(152, 0, 3, .36), inset 0 1px 0 rgba(255, 255, 255, .28);
    color: #fff;
}

.rf-sidebar-collapse:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.rf-collapse-compact { display: none; }

.rf-sidebar-search-panel {
    padding: .55rem .65rem;
    border-bottom: 1px solid rgba(255, 255, 255, .075);
    background: rgba(5, 5, 7, .12);
}

.rf-sidebar-search {
    position: relative;
    display: flex;
    align-items: center;
}

.rf-sidebar-search-icon {
    position: absolute;
    z-index: 1;
    left: .68rem;
    display: grid;
    place-items: center;
    color: #86868e;
    pointer-events: none;
}

.rf-sidebar-search input {
    width: 100%;
    height: 38px;
    padding: 0 2.15rem 0 2.15rem;
    border: 1px solid rgba(255, 255, 255, .115);
    border-radius: 10px;
    outline: 0;
    background: rgba(255, 255, 255, .065);
    color: #fff;
    font-size: .75rem;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.rf-sidebar-search input::placeholder { color: #818189; }

.rf-sidebar-search input:focus {
    border-color: rgba(229, 3, 5, .72);
    background: rgba(255, 255, 255, .075);
    box-shadow: 0 0 0 3px rgba(229, 3, 5, .12);
}

.rf-sidebar-search-clear {
    position: absolute;
    right: .25rem;
    display: grid;
    width: 30px;
    height: 30px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #9999a0;
}

.rf-sidebar-search-clear:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.rf-sidebar-search-compact {
    display: none;
    width: 42px;
    height: 42px;
    margin: 0 auto;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035));
    color: #d2d2d7;
}

.rf-sidebar-nav {
    padding: .45rem .55rem .7rem;
}

.rf-nav-group { display: block; }
.rf-nav-group + .rf-nav-group { margin-top: .15rem; }
.rf-nav-group-items { display: flex; flex-direction: column; }

.rf-nav-section {
    display: flex;
    width: 100%;
    min-height: 32px;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin: .35rem 0 .12rem;
    padding: .28rem .52rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #808087;
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .13em;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.rf-nav-section:hover { background: rgba(255, 255, 255, .045); color: #b9b9bf; }
.rf-nav-section .rf-icon { transition: transform var(--transition); }
.rf-nav-group:first-child .rf-nav-section { margin-top: .05rem; }
.rf-nav-section::before,
.rf-nav-section::after { display: none; }

.rf-nav-item {
    min-height: 44px;
    margin: 1px 0;
    padding: .48rem .5rem;
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    border-radius: 8px;
    background: rgba(255, 255, 255, .022);
    box-shadow: none;
    color: #c9c9ce;
    font-size: .78rem;
    font-weight: 550;
    text-align: left;
    transform: none;
}

.rf-nav-item::before { display: none; }

.rf-nav-item:hover {
    border-color: rgba(255, 255, 255, .1);
    border-left-color: rgba(239, 34, 38, .7);
    background: linear-gradient(90deg, rgba(239, 34, 38, .11), rgba(255, 255, 255, .065));
    box-shadow: none;
    color: #fff;
    transform: none;
}

.rf-nav-item.is-active {
    min-height: 44px;
    border-color: rgba(239, 34, 38, .28);
    border-left-color: var(--primary);
    background: linear-gradient(100deg, rgba(229, 3, 5, .26), rgba(87, 30, 33, .18) 54%, rgba(255, 255, 255, .055));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055), 0 6px 16px rgba(0, 0, 0, .12);
    color: #fff;
    font-weight: 670;
    animation: none;
}

.rf-nav-item.is-active::after {
    top: 50%;
    right: 9px;
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(229, 3, 5, .14);
    transform: translateY(-50%);
}

.rf-nav-item.is-active.has-nav-badge::after { display: none; }

.rf-nav-item .rf-icon {
    width: 28px;
    height: 28px;
    flex: none;
    color: #aaaab2;
    border: 1px solid rgba(255, 255, 255, .055);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
    box-shadow: none;
    opacity: 1;
}

.rf-nav-item:hover .rf-icon,
.rf-nav-item.is-active .rf-icon {
    color: #fff;
    border-color: rgba(239, 34, 38, .28);
    background: rgba(229, 3, 5, .16);
    box-shadow: 0 0 16px rgba(229, 3, 5, .12);
    transform: none;
}

.rf-nav-label {
    flex: 1;
    width: auto;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.35;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rf-nav-badge {
    position: static;
    min-width: 20px;
    height: 20px;
    border: 0;
    background: var(--primary);
    box-shadow: none;
}

.rf-sidebar-empty {
    margin: .8rem .35rem;
    padding: .75rem .6rem;
    border: 1px dashed rgba(255, 255, 255, .12);
    border-radius: 9px;
    color: #9999a0;
    font-size: .7rem;
    line-height: 1.45;
    text-align: center;
}

.rf-sidebar-foot {
    padding: .5rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
    background: linear-gradient(180deg, rgba(13, 14, 18, .7), rgba(6, 7, 9, .9));
}

.rf-sidebar-utilities {
    display: grid;
    gap: 2px;
    margin-bottom: .45rem;
    padding-bottom: .45rem;
    border-bottom: 1px solid rgba(255, 255, 255, .075);
}

.rf-sidebar-utilities > a {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: .55rem;
    padding: .42rem .55rem;
    border-radius: 8px;
    color: #a9a9b0;
    font-size: .75rem;
    font-weight: 560;
}

.rf-sidebar-utilities > a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.rf-sidebar-utilities > a > span:nth-child(2) { flex: 1; min-width: 0; }

.rf-sidebar-account {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    gap: .25rem;
    padding: .3rem;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.rf-sidebar-account form { margin: 0; }

.rf-sidebar-user {
    min-width: 0;
    min-height: 44px;
    padding: .3rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    text-align: left;
}

.rf-sidebar-user:hover {
    background: rgba(255, 255, 255, .06);
    box-shadow: none;
}

.rf-sidebar-user .rf-su-meta {
    width: auto;
    align-items: flex-start;
}

.rf-sidebar-user .rf-su-name { font-size: .78rem; }
.rf-sidebar-user .rf-su-role { font-size: .66rem; }

.rf-sidebar-signout {
    position: relative;
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #96969d;
}

.rf-sidebar-signout:hover { background: rgba(229, 3, 5, .14); color: #ff7779; }

:root.rf-sidebar-collapsed { --sidebar-width: var(--sidebar-compact-width); }

:root.rf-sidebar-collapsed .rf-sidebar::before { opacity: .2; }

:root.rf-sidebar-collapsed .rf-sidebar::after {
    inset: 0 12px auto;
    width: auto;
    height: 2px;
    border-radius: 0 0 var(--radius-pill) var(--radius-pill);
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    box-shadow: 0 0 16px rgba(229, 3, 5, .34);
}

:root.rf-sidebar-collapsed .rf-sidebar-decor::before,
:root.rf-sidebar-collapsed .rf-sidebar-decor::after,
:root.rf-sidebar-collapsed .rf-sidebar-shape.is-diamond,
:root.rf-sidebar-collapsed .rf-sidebar-shape.is-dots { display: none; }

:root.rf-sidebar-collapsed .rf-sidebar-shape.is-ring {
    top: 38%;
    left: -38px;
    opacity: .38;
}

:root.rf-sidebar-collapsed .rf-sidebar-head { min-height: 96px; }

:root.rf-sidebar-collapsed .rf-sidebar-brand {
    height: 100%;
    align-items: flex-start;
    justify-content: center;
    padding: .65rem .7rem 3.15rem;
}

:root.rf-sidebar-collapsed .rf-sidebar-brand .rf-brand-text,
:root.rf-sidebar-collapsed .rf-sidebar-search,
:root.rf-sidebar-collapsed .rf-nav-section,
:root.rf-sidebar-collapsed .rf-nav-label,
:root.rf-sidebar-collapsed .rf-sidebar-utilities > a > span:not(.rf-nav-badge),
:root.rf-sidebar-collapsed .rf-sidebar-user .rf-su-meta { display: none; }

:root.rf-sidebar-collapsed .rf-sidebar-collapse {
    top: auto;
    right: 50%;
    bottom: .55rem;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    transform: translateX(50%);
}

:root.rf-sidebar-collapsed .rf-collapse-expanded { display: none; }
:root.rf-sidebar-collapsed .rf-collapse-compact { display: inline-grid; }
:root.rf-sidebar-collapsed .rf-sidebar-search-compact { display: grid; }
:root.rf-sidebar-collapsed .rf-sidebar-search-panel { padding: .5rem .35rem; }
:root.rf-sidebar-collapsed .rf-nav-group-items { display: flex !important; }
:root.rf-sidebar-collapsed .rf-sidebar-nav { padding: .45rem .35rem .7rem; }
:root.rf-sidebar-collapsed .rf-nav-group + .rf-nav-group { margin-top: .4rem; padding-top: .4rem; border-top: 1px solid rgba(255, 255, 255, .065); }
:root.rf-sidebar-collapsed .rf-nav-item {
    width: 44px;
    min-height: 44px;
    justify-content: center;
    margin: 1px auto;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
}

:root.rf-sidebar-collapsed .rf-nav-item .rf-icon {
    width: 38px;
    height: 38px;
    border-color: rgba(255, 255, 255, .075);
    border-radius: 11px;
    background: rgba(255, 255, 255, .045);
}

:root.rf-sidebar-collapsed .rf-nav-item.is-active {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

:root.rf-sidebar-collapsed .rf-nav-item:hover { border-color: transparent; }

:root.rf-sidebar-collapsed .rf-nav-item:hover .rf-icon {
    border-color: rgba(255, 255, 255, .13);
    background: rgba(255, 255, 255, .09);
}

:root.rf-sidebar-collapsed .rf-nav-item.is-active .rf-icon {
    border-color: rgba(239, 34, 38, .38);
    background: linear-gradient(145deg, rgba(229, 3, 5, .24), rgba(255, 255, 255, .055));
    box-shadow: 0 0 18px rgba(229, 3, 5, .15);
}

:root.rf-sidebar-collapsed .rf-nav-item.is-active::after {
    top: 50%;
    right: 0;
    width: 3px;
    height: 18px;
    border-radius: 3px 0 0 3px;
    transform: translateY(-50%);
}
:root.rf-sidebar-collapsed .rf-nav-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; font-size: .55rem; }
:root.rf-sidebar-collapsed .rf-sidebar-foot { padding: .45rem .35rem; }
:root.rf-sidebar-collapsed .rf-sidebar-utilities > a {
    position: relative;
    width: 44px;
    min-height: 42px;
    justify-content: center;
    margin: 0 auto;
    padding: 0;
}

:root.rf-sidebar-collapsed .rf-sidebar-account {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .2rem;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

:root.rf-sidebar-collapsed .rf-sidebar-account form {
    display: grid;
    width: 100%;
    place-items: center;
}

:root.rf-sidebar-collapsed .rf-sidebar-user {
    width: 44px;
    min-height: 44px;
    justify-content: center;
    padding: .2rem;
}

:root.rf-sidebar-collapsed .rf-sidebar-signout { width: 42px; height: 38px; }

.rf-main {
    margin-left: calc(var(--sidebar-width) + (var(--sidebar-gap) * 2));
    transition: none;
}
.rf-page-loader { left: calc(var(--sidebar-width) + (var(--sidebar-gap) * 2)); }

.rf-topbar {
    height: var(--topbar-height);
    padding: 0 var(--interface-gutter);
    gap: .8rem;
    border-bottom: 1px solid var(--interface-line);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .75);
    backdrop-filter: blur(16px) saturate(125%);
}

:root[data-theme="dark"] .rf-topbar { box-shadow: 0 1px 0 rgba(255, 255, 255, .025); }

.rf-topbar-logo { display: none; }

.rf-topbar-title {
    display: block;
    max-width: 220px;
    overflow: hidden;
    color: var(--text-primary);
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rf-topbar-title::before {
    display: inline-block;
    width: 3px;
    height: 18px;
    margin-right: .65rem;
    border-radius: var(--radius-pill);
    background: var(--primary);
    vertical-align: -4px;
    content: "";
}

.rf-search {
    max-width: 520px;
    margin-left: clamp(.25rem, 1.5vw, 1.5rem);
}

.rf-search input {
    height: 40px;
    border-color: var(--interface-line);
    border-radius: 10px;
    background: var(--surface-secondary);
}

.rf-search input:hover { border-color: var(--interface-line-strong); }

.rf-search input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--interface-ring);
}

.rf-search-shortcut {
    border-color: var(--interface-line);
    background: var(--surface);
    color: var(--text-muted);
}

.rf-icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid transparent;
    border-radius: 10px;
}

.rf-icon-btn:hover {
    border-color: var(--interface-line);
    background: var(--surface-secondary);
}

.rf-avatar {
    display: inline-grid;
    flex: none;
    overflow: hidden;
    place-items: center;
    border: 1px solid var(--interface-line);
    border-radius: 50%;
    background: var(--surface-sunken);
    object-fit: cover;
    vertical-align: middle;
}

.rf-avatar-initials {
    border: 0;
    color: #fff;
    font-weight: 720;
    line-height: 1;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.rf-avatar-stack { display: inline-flex; }
.rf-avatar-stack .rf-avatar {
    margin-left: -8px;
    border: 2px solid var(--surface);
}
.rf-avatar-stack .rf-avatar:first-child { margin-left: 0; }

.rf-presence {
    position: relative;
    display: inline-flex;
    flex: none;
    line-height: 0;
}

.rf-presence::after {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--text-muted);
    content: "";
}

.rf-presence.is-online::after { background: var(--success); }

.rf-account-trigger {
    width: auto;
    min-width: 64px;
    height: 44px;
    gap: .4rem;
    padding: .25rem .45rem .25rem .3rem;
    border-color: var(--interface-line);
    background: var(--surface);
}

.rf-account-trigger .rf-avatar {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--interface-line);
}

.rf-account-trigger > .rf-icon {
    color: var(--text-muted);
    transition: color var(--transition), transform var(--transition);
}

.rf-account-trigger:hover > .rf-icon { color: var(--text-primary); }
.rf-account-trigger[aria-expanded="true"] > .rf-icon { transform: rotate(180deg); }

.rf-dropdown-panel,
.rf-search-results {
    border-color: var(--interface-line);
    border-radius: 14px;
    box-shadow: var(--interface-float-shadow);
}

.rf-dropdown-item,
.rf-search-item { min-height: 42px; }

.rf-content {
    width: 100%;
    max-width: var(--interface-max);
    margin: 0 auto;
    padding: clamp(1.5rem, 2.8vw, 2.6rem) var(--interface-gutter) 4rem;
    background-image: none;
}

:root[data-theme="dark"] .rf-content { background-image: none; }

.rf-page-head {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 1rem 2rem;
    margin-bottom: 1.6rem;
    padding: .15rem 0 1.25rem 1.15rem;
    border-bottom: 1px solid var(--interface-line);
}

.rf-page-head > div:first-child::before {
    position: absolute;
    inset: .2rem auto 1.25rem 0;
    width: 4px;
    height: auto;
    margin: 0;
    border-radius: var(--radius-pill);
    background: var(--primary);
    box-shadow: none;
}

.rf-page-title {
    max-width: 26ch;
    color: var(--text-primary);
    font-size: clamp(1.55rem, 2.3vw, 2rem);
    font-weight: 760;
    letter-spacing: -.035em;
    line-height: 1.12;
}

.rf-page-subtitle {
    max-width: 72ch;
    margin-top: .42rem;
    color: var(--text-secondary);
    font-size: .88rem;
    line-height: 1.55;
}

.rf-breadcrumb {
    margin-bottom: .45rem;
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 620;
}

.rf-breadcrumb a { color: var(--text-muted); }
.rf-page-actions { justify-content: flex-end; }

/* ---------------------------------------------------------------------
   Surfaces, hierarchy, and data
   ------------------------------------------------------------------ */

.rf-card,
.rf-stat,
.rf-action-hero {
    border-color: var(--interface-line);
    border-radius: 14px;
    background: var(--interface-panel);
    box-shadow: var(--interface-panel-shadow);
}

.rf-card {
    position: relative;
    overflow: clip;
}

.rf-card:hover,
:root[data-theme="dark"] .rf-card:hover { box-shadow: var(--interface-panel-shadow); }

.rf-card-head {
    min-height: 58px;
    padding: .9rem 1.15rem;
    border-bottom-color: var(--interface-line);
    background: var(--interface-panel-muted);
}

.rf-card-head h2,
.rf-card-head h3,
.rf-card-head h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: .93rem;
    font-weight: 710;
    letter-spacing: -.012em;
}

.rf-card-body { padding: 1.15rem; }
.rf-card-foot {
    padding: .85rem 1.15rem;
    border-top-color: var(--interface-line);
    background: var(--interface-panel-muted);
}

.rf-grid,
.rf-grid-2,
.rf-grid-3,
.rf-grid-4,
.rf-grid-sidebar,
.rf-grid-sidebar-left { align-items: start; }

.u-grid-gap { gap: 1.1rem; }
.u-grid-gap-sm { gap: .8rem; }
.u-grid-gap-lg { gap: 1.35rem; }

.rf-stat {
    min-height: 116px;
    padding: 1.1rem 1.15rem 1.05rem 1.3rem;
    align-items: center;
    transform: none;
}

.rf-stat:hover,
:root[data-theme="dark"] .rf-stat:hover {
    box-shadow: var(--interface-panel-shadow);
    transform: none;
}

.rf-stat::before {
    inset: 0 auto 0 0;
    width: 4px;
    height: auto;
    background: var(--border-strong);
}

.rf-stat.is-brand,
.rf-stat.is-success,
.rf-stat.is-warning,
.rf-stat.is-danger,
.rf-stat.is-dark { border-left-width: 1px; }

.rf-stat-icon {
    width: 44px;
    height: 44px;
    border: 1px solid var(--interface-line);
    border-radius: 11px;
}

.rf-stat:hover .rf-stat-icon { transform: none; }

.rf-stat-label {
    color: var(--text-muted);
    font-size: .65rem;
    letter-spacing: .085em;
}

.rf-stat-value {
    margin-top: .24rem;
    font-size: clamp(1.55rem, 2vw, 1.85rem);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.045em;
}

.rf-stat-meta { margin-top: .28rem; }

.rf-section-heading {
    margin: 1.7rem 0 .75rem;
    color: var(--text-muted);
    font-size: .66rem;
    letter-spacing: .12em;
}

.rf-section-heading::before {
    width: 18px;
    height: 3px;
    border-radius: var(--radius-pill);
    background: var(--primary);
    content: "";
}

.rf-section-heading::after { background: var(--interface-line); }

.rf-list-item {
    min-height: 58px;
    padding: .78rem 1.15rem;
    border-bottom-color: var(--interface-line);
}

a.rf-list-item:hover {
    background: var(--surface-secondary);
    color: var(--text-primary);
}

.rf-list-icon {
    width: 38px;
    height: 38px;
    border: 1px solid var(--interface-line);
    border-radius: 10px;
}

.rf-list-title { font-weight: 650; }
.rf-list-sub { margin-top: .1rem; line-height: 1.45; }

.rf-filters {
    gap: .75rem;
    margin-bottom: 1rem;
    padding: .9rem;
    border: 1px solid var(--interface-line);
    border-radius: 14px;
    background: var(--interface-panel);
    box-shadow: var(--shadow-xs);
}

:root[data-theme="dark"] .rf-filters { background: var(--interface-panel); }

.rf-table-wrap {
    border-radius: 0 0 14px 14px;
    scrollbar-gutter: stable;
}

.rf-table {
    color: var(--text-primary);
    font-size: .825rem;
}

.rf-table thead th {
    height: 44px;
    padding: .7rem .9rem;
    border-bottom: 1px solid var(--interface-line-strong);
    background: var(--interface-panel-muted);
    color: var(--text-muted);
    font-size: .64rem;
    font-weight: 720;
    letter-spacing: .075em;
}

:root[data-theme="dark"] .rf-table thead th { background: var(--interface-panel-muted); }

.rf-table tbody td {
    min-height: 52px;
    padding: .78rem .9rem;
    border-bottom-color: var(--interface-line);
}

.rf-table tbody tr:hover,
:root[data-theme="dark"] .rf-table tbody tr:hover { background: var(--surface-secondary); }

.rf-table-tools {
    gap: .65rem;
    padding: .85rem 1rem;
    border-bottom-color: var(--interface-line);
    background: var(--interface-panel);
}

.rf-table-tools-search .rf-input { min-height: 40px; }

.rf-tabs {
    gap: .15rem;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--interface-line);
    border-radius: 0;
    background: transparent;
}

.rf-tab {
    min-height: 44px;
    padding: .7rem .85rem;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--text-muted);
    font-weight: 620;
}

.rf-tab:hover { color: var(--text-primary); }
.rf-tab.is-active,
.rf-tab[aria-selected="true"] {
    border-bottom-color: var(--primary);
    background: transparent;
    color: var(--text-primary);
}

.rf-badge {
    min-height: 24px;
    padding: .18rem .55rem;
    border: 1px solid currentColor;
    font-size: .66rem;
    letter-spacing: .015em;
}

.rf-alert {
    border-width: 1px;
    border-left-width: 4px;
    border-radius: 10px;
    padding: .85rem .95rem;
}

.rf-empty,
.rf-empty-state { padding: clamp(2.25rem, 5vw, 4rem) 1.5rem; }

.rf-empty-icon,
.rf-empty-state-icon,
.rf-empty-illustration {
    border: 1px solid var(--interface-line);
    background: var(--surface-secondary);
    color: var(--text-muted);
}

.rf-pagination {
    min-height: 58px;
    border-top: 1px solid var(--interface-line);
}

.rf-pagination-pages a,
.rf-pagination-pages span {
    min-width: 36px;
    height: 36px;
    border: 1px solid transparent;
}

.rf-pagination-pages a:hover { border-color: var(--interface-line); }

/* ---------------------------------------------------------------------
   Controls and feedback
   ------------------------------------------------------------------ */

.rf-btn {
    min-height: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: .84rem;
    font-weight: 670;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.rf-btn:active { transform: none; }

.rf-btn-primary,
:root[data-theme="dark"] .rf-btn-primary {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: var(--interface-red-shadow);
}

.rf-btn-primary:hover:not(:disabled),
:root[data-theme="dark"] .rf-btn-primary:hover:not(:disabled) {
    border-color: var(--primary-hover);
    background: var(--primary-hover);
    box-shadow: 0 10px 24px rgba(185, 2, 4, .23);
    transform: none;
}

.rf-btn-ghost,
:root[data-theme="dark"] .rf-btn-ghost {
    border-color: var(--interface-line);
    background: var(--surface);
}

.rf-btn-ghost:hover:not(:disabled),
:root[data-theme="dark"] .rf-btn-ghost:hover:not(:disabled) {
    border-color: var(--interface-line-strong);
    background: var(--surface-secondary);
}

.rf-btn-sm {
    min-height: 34px;
    height: 34px;
    border-radius: 8px;
}

.rf-btn-lg { min-height: 48px; height: 48px; }
.rf-btn-xl { min-height: 54px; height: 54px; }
.rf-btn-link { min-height: auto; height: auto; }

.rf-label {
    color: var(--text-primary);
    font-size: .78rem;
    font-weight: 660;
}

.rf-hint {
    color: var(--text-muted);
    font-size: .72rem;
    line-height: 1.45;
}

.rf-input,
.rf-select,
.rf-textarea,
:root[data-theme="dark"] .rf-input,
:root[data-theme="dark"] .rf-select,
:root[data-theme="dark"] .rf-textarea {
    min-height: 44px;
    border-color: var(--interface-line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-primary);
}

.rf-input:hover,
.rf-select:hover,
.rf-textarea:hover { border-color: color-mix(in srgb, var(--text-muted) 70%, var(--interface-line)); }

.rf-input:focus,
.rf-select:focus,
.rf-textarea:focus,
:root[data-theme="dark"] .rf-input:focus,
:root[data-theme="dark"] .rf-select:focus,
:root[data-theme="dark"] .rf-textarea:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--interface-ring);
}

.rf-check,
.rf-radio { min-height: 32px; }

.rf-check input,
.rf-radio input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.rf-modal-backdrop { background: rgba(9, 9, 11, .62); }

.rf-modal {
    border-color: var(--interface-line);
    border-radius: 16px;
    box-shadow: var(--interface-float-shadow);
}

.rf-modal-head {
    border-bottom-color: var(--interface-line);
    background: var(--interface-panel-muted);
}

.rf-modal-foot {
    border-top-color: var(--interface-line);
    background: var(--interface-panel-muted);
}

.rf-undo-toast,
:root[data-theme="dark"] .rf-undo-toast {
    border-color: var(--interface-line);
    border-left-color: var(--success);
    background: var(--surface);
    box-shadow: var(--interface-float-shadow);
}

.rf-action-hero {
    border-left: 4px solid var(--primary);
    box-shadow: var(--interface-panel-shadow);
}

.rf-action-hero:hover { box-shadow: var(--interface-panel-shadow); }

.rf-app-foot {
    max-width: var(--interface-max);
    width: 100%;
    margin: 0 auto;
    padding: 1.1rem var(--interface-gutter) 1.35rem;
    border-top: 1px solid var(--interface-line);
    background: transparent;
    color: var(--text-muted);
}

/* ---------------------------------------------------------------------
   Authentication, lock, and error surfaces
   ------------------------------------------------------------------ */

.rf-login-shell { background: var(--background); }

.rf-login-brand {
    background:
        linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px),
        #101012;
    background-size: 44px 44px;
}

.rf-login-brand::before {
    opacity: .82;
    background: linear-gradient(135deg, rgba(229, 3, 5, .88), rgba(229, 3, 5, .08));
}

.rf-login-brand::after { opacity: .38; }

.rf-login-brand-glow {
    background: radial-gradient(circle, rgba(229, 3, 5, .15), transparent 67%);
}

.rf-login-capabilities > div {
    border-color: rgba(255, 255, 255, .1);
    border-left: 3px solid rgba(229, 3, 5, .7);
    background: rgba(255, 255, 255, .045);
    box-shadow: none;
}

.rf-login-access {
    background:
        radial-gradient(circle at 100% 0, rgba(229, 3, 5, .07), transparent 26rem),
        var(--background);
}

.rf-login-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--interface-line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--interface-float-shadow);
}

.rf-login-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0 28%, var(--racio-charcoal) 28% 42%, var(--border-color) 42%);
    content: "";
}

.rf-login-card-head h1 { letter-spacing: -.04em; }

.rf-login-form .rf-input,
:root[data-theme="dark"] .rf-login-form .rf-input {
    min-height: 48px;
    border-color: var(--interface-line-strong);
    background: var(--surface);
}

.rf-login-submit {
    min-height: 48px;
    height: 48px;
}

.rf-auth {
    background:
        radial-gradient(circle at 8% 8%, rgba(229, 3, 5, .08), transparent 23rem),
        var(--background);
}

.rf-auth-brand {
    background: #101012;
}

.rf-auth-panel { background: var(--background); }

.rf-auth-form {
    position: relative;
    overflow: hidden;
    padding: clamp(1.4rem, 4vw, 2rem);
    border: 1px solid var(--interface-line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--interface-panel-shadow);
}

.rf-auth-form::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--primary);
    content: "";
}

.rf-lock,
.rf-errpage {
    background:
        radial-gradient(circle at 85% 15%, rgba(229, 3, 5, .09), transparent 22rem),
        linear-gradient(rgba(229, 3, 5, .018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(229, 3, 5, .018) 1px, transparent 1px),
        var(--background);
    background-size: auto, 44px 44px, 44px 44px, auto;
}

.rf-lock::before,
.rf-lock::after { opacity: .045; }

.rf-lock-card,
.rf-errcard {
    border-color: var(--interface-line);
    border-radius: 18px;
    box-shadow: var(--interface-float-shadow);
}

.rf-lock-card::before,
.rf-errcard::after {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0 34%, var(--border-color) 34%);
    content: "";
}

.rf-errcard::before { opacity: .035; }

.rf-database-error {
    background:
        radial-gradient(circle at 85% 15%, rgba(229, 3, 5, .09), transparent 22rem),
        #f4f5f7;
}

.rf-database-error .card {
    border-color: #dedfe3;
    border-radius: 18px;
    box-shadow: 0 18px 46px rgba(17, 17, 20, .12);
}

.rf-database-error .card::after {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #e50305 0 30%, #5a5456 30% 43%, #dedfe3 43%);
    content: "";
}

.rf-database-error .actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.35rem;
    padding-top: 1.1rem;
    border-top: 1px solid #dedfe3;
}

.rf-database-error .retry {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    border: 1px solid #e50305;
    border-radius: 10px;
    background: #e50305;
    box-shadow: 0 8px 20px rgba(185, 2, 4, .17);
    color: #fff;
    font-size: .84rem;
    font-weight: 670;
    text-decoration: none;
}

.rf-database-error .retry:hover {
    border-color: #c90204;
    background: #c90204;
    color: #fff;
}

.rf-database-error .retry:focus-visible {
    outline: 2px solid #e50305;
    outline-offset: 3px;
}

/* ---------------------------------------------------------------------
   Responsive system
   ------------------------------------------------------------------ */

@media (min-width: 901px) {
    .rf-sidebar-brand {
        flex-direction: row;
        justify-content: flex-start;
        gap: .55rem;
        overflow: visible;
    }

    .rf-sidebar-brand .rf-brand-text { align-items: flex-start; }

    .rf-nav-section {
        display: block;
        line-height: 1.3;
    }

    .rf-nav-item {
        flex-direction: row;
        justify-content: flex-start;
        gap: .55rem;
    }

    .rf-sidebar-user {
        flex-direction: row;
        justify-content: flex-start;
        gap: .5rem;
    }
}

@media (max-width: 1100px) and (min-width: 901px) {
    :root { --sidebar-expanded-width: 210px; }
    .rf-sidebar-brand .rf-brand-sub { max-width: 96px; letter-spacing: .055em; }
    .rf-topbar-title { max-width: 150px; }
}

@media (max-width: 900px) {
    :root { --topbar-height: 60px; }

    .rf-sidebar {
        inset: 8px auto 8px 8px;
        width: min(280px, calc(100vw - 16px));
        border: 1px solid rgba(255, 255, 255, .1);
        border-radius: 16px;
        box-shadow: none;
        transform: translateX(calc(-100% - 16px));
    }

    .rf-sidebar-collapse { display: none; }

    body.rf-nav-open .rf-sidebar { box-shadow: var(--interface-float-shadow); }

    .rf-sidebar::after {
        inset: 18px 0 18px auto;
        height: auto;
        border-radius: var(--radius-pill) 0 0 var(--radius-pill);
    }

    .rf-sidebar-brand {
        min-height: 76px;
        flex-direction: row;
        justify-content: flex-start;
        padding: .85rem 1rem;
    }

    .rf-sidebar-head { min-height: 76px; }

    .rf-sidebar-brand .rf-brand-text { display: flex; align-items: flex-start; }
    .rf-sidebar-brand .rf-brand-sub { display: block; }
    .rf-sidebar-nav { padding: .65rem .65rem .9rem; }
    .rf-nav-section { display: block; margin: .9rem .65rem .32rem; text-align: left; }

    .rf-nav-item {
        min-height: 44px;
        flex-direction: row;
        justify-content: flex-start;
        gap: .68rem;
        padding: .62rem .7rem;
        text-align: left;
    }

    .rf-nav-label {
        width: auto;
        font-size: .82rem;
        text-align: left;
        white-space: nowrap;
    }

    .rf-nav-item.is-active { min-height: 44px; }
    .rf-sidebar-user { flex-direction: row; text-align: left; }
    .rf-sidebar-user .rf-su-meta { width: auto; align-items: flex-start; }
    .rf-main { margin-left: 0; }
    .rf-page-loader { left: 0; }

    .rf-topbar { padding: 0 1rem; }
    .rf-topbar-title { max-width: min(36vw, 240px); }
    .rf-topbar-title::before { display: none; }

    .rf-content {
        padding: 1.4rem 1rem calc(var(--mobile-nav-height, 66px) + 2.25rem);
    }

    .rf-page-head { padding-bottom: 1rem; }

    :root.rf-sidebar-collapsed .rf-sidebar::before { opacity: .46; }

    :root.rf-sidebar-collapsed .rf-sidebar::after {
        inset: 18px 0 18px auto;
        width: 3px;
        height: auto;
        border-radius: var(--radius-pill) 0 0 var(--radius-pill);
    }

    :root.rf-sidebar-collapsed .rf-sidebar-decor::before,
    :root.rf-sidebar-collapsed .rf-sidebar-decor::after,
    :root.rf-sidebar-collapsed .rf-sidebar-shape.is-diamond,
    :root.rf-sidebar-collapsed .rf-sidebar-shape.is-dots { display: block; }

    :root.rf-sidebar-collapsed .rf-sidebar-head { min-height: 76px; }

    :root.rf-sidebar-collapsed .rf-sidebar-brand {
        height: auto;
        align-items: center;
        justify-content: flex-start;
        padding: .85rem 1rem;
    }

    :root.rf-sidebar-collapsed .rf-sidebar-brand .rf-brand-text,
    :root.rf-sidebar-collapsed .rf-sidebar-search,
    :root.rf-sidebar-collapsed .rf-nav-section,
    :root.rf-sidebar-collapsed .rf-nav-label,
    :root.rf-sidebar-collapsed .rf-sidebar-utilities > a > span:not(.rf-nav-badge),
    :root.rf-sidebar-collapsed .rf-sidebar-user .rf-su-meta { display: flex; }

    :root.rf-sidebar-collapsed .rf-sidebar-brand .rf-brand-text,
    :root.rf-sidebar-collapsed .rf-sidebar-user .rf-su-meta { flex-direction: column; }

    :root.rf-sidebar-collapsed .rf-sidebar-search-compact { display: none; }
    :root.rf-sidebar-collapsed .rf-sidebar-search-panel { padding: .55rem .65rem; }
    :root.rf-sidebar-collapsed .rf-sidebar-nav { padding: .65rem .65rem .9rem; }
    :root.rf-sidebar-collapsed .rf-nav-group + .rf-nav-group { margin-top: .15rem; padding-top: 0; border-top: 0; }
    :root.rf-sidebar-collapsed .rf-nav-item,
    :root.rf-sidebar-collapsed .rf-nav-item.is-active {
        width: auto;
        min-height: 44px;
        justify-content: flex-start;
        margin: 1px 0;
        padding: .62rem .7rem;
        border-left: 3px solid transparent;
        border-radius: 8px;
    }

    :root.rf-sidebar-collapsed .rf-nav-item.is-active { border-left-color: var(--primary); }
    :root.rf-sidebar-collapsed .rf-nav-item.is-active::after {
        top: 50%;
        right: 9px;
        width: 5px;
        height: 5px;
        border-radius: 50%;
        transform: translateY(-50%);
    }
    :root.rf-sidebar-collapsed .rf-nav-item .rf-icon {
        width: 28px;
        height: 28px;
        border-color: rgba(255, 255, 255, .055);
        border-radius: 8px;
        background: rgba(255, 255, 255, .035);
    }

    :root.rf-sidebar-collapsed .rf-nav-item.is-active {
        border-color: rgba(239, 34, 38, .28);
        border-left-color: var(--primary);
        background: linear-gradient(100deg, rgba(229, 3, 5, .26), rgba(87, 30, 33, .18) 54%, rgba(255, 255, 255, .055));
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055), 0 6px 16px rgba(0, 0, 0, .12);
    }

    :root.rf-sidebar-collapsed .rf-nav-badge { position: static; min-width: 20px; height: 20px; padding: 0 6px; font-size: .625rem; }
    :root.rf-sidebar-collapsed .rf-sidebar-foot { padding: .5rem; }
    :root.rf-sidebar-collapsed .rf-sidebar-utilities > a {
        width: auto;
        min-height: 44px;
        justify-content: flex-start;
        margin: 0;
        padding: .42rem .55rem;
    }

    :root.rf-sidebar-collapsed .rf-sidebar-account {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 34px;
        padding: .3rem;
    }

    :root.rf-sidebar-collapsed .rf-sidebar-user { justify-content: flex-start; padding: .3rem; }
    :root.rf-sidebar-collapsed .rf-sidebar-signout { width: 34px; height: 34px; }
}

@media (max-width: 767px) {
    .rf-input,
    .rf-select,
    .rf-textarea,
    .rf-search input { font-size: 16px; }

    .rf-page-head {
        display: flex;
        align-items: stretch;
        gap: .85rem;
        margin-bottom: 1.15rem;
        padding-left: .9rem;
    }

    .rf-page-head > div:first-child::before { bottom: 1rem; width: 3px; }
    .rf-page-title { font-size: 1.48rem; }
    .rf-page-subtitle { font-size: .82rem; }

    .rf-page-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
        width: 100%;
    }

    .rf-page-actions .rf-btn { width: 100%; }
    .rf-card-head { min-height: 54px; padding: .8rem 1rem; }
    .rf-card-body { padding: 1rem; }
    .rf-card-foot { padding: .8rem 1rem; }
    .rf-stat { min-height: 100px; padding: .95rem 1rem .95rem 1.2rem; }
    .rf-list-item { padding: .75rem 1rem; }

    .rf-table.is-stacked tbody tr {
        border-color: var(--interface-line);
        border-left: 3px solid var(--border-strong);
        border-radius: 12px;
        box-shadow: var(--shadow-xs);
    }

    .rf-table.is-stacked tbody td { border-bottom-color: var(--interface-line); }

    .rf-modal {
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -18px 46px rgba(17, 17, 20, .18);
    }

    .rf-mobile-nav {
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        left: 8px;
        width: auto;
        height: 64px;
        padding: 5px;
        border: 1px solid var(--interface-line);
        border-radius: 16px;
        background: color-mix(in srgb, var(--surface) 95%, transparent);
        box-shadow: 0 12px 34px rgba(17, 17, 20, .16);
        backdrop-filter: blur(18px) saturate(130%);
    }

    .rf-mobile-nav-item {
        min-width: 0;
        min-height: 52px;
        border-radius: 11px;
        font-size: .62rem;
    }

    .rf-mobile-nav-item.is-active {
        background: var(--primary-soft);
        color: var(--primary);
    }

    .rf-mobile-nav-indicator { display: none; }
    .rf-app-foot { margin-bottom: calc(80px + env(safe-area-inset-bottom)); }

    .rf-auth-form { padding: 1.35rem 1.1rem; }
}

@media (max-width: 520px) {
    .rf-topbar { gap: .25rem; padding: 0 .65rem; }
    .rf-topbar-title { max-width: 32vw; font-size: .8rem; }
    .rf-topbar-actions { gap: .05rem; }
    .rf-topbar-actions .rf-icon-btn { width: 38px; height: 38px; }
    .rf-content { padding-right: .75rem; padding-left: .75rem; }
    .rf-page-title { font-size: 1.38rem; }
    .rf-page-actions { grid-template-columns: minmax(0, 1fr); }

    .rf-pagination-pages {
        max-width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: .25rem;
    }

    .rf-login-access {
        padding: 0;
        background: var(--surface);
    }

    .rf-login-card {
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .rf-lock-card,
    .rf-errcard,
    .rf-database-error .card { padding: 1.75rem 1.2rem 1.35rem; }

    .rf-database-error .actions { justify-content: stretch; }
    .rf-database-error .retry { width: 100%; }
}

@media (hover: none) and (pointer: coarse) {
    .rf-btn,
    .rf-icon-btn,
    .rf-dropdown-item,
    .rf-search-item,
    .rf-nav-item { min-height: 44px; }

    .rf-btn.rf-btn-sm,
    .rf-icon-btn { height: 44px; }

    .rf-icon-btn { width: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .rf-sidebar,
    .rf-modal,
    .rf-dropdown-panel,
    .rf-search-results { scroll-behavior: auto; }
}

@media print {
    .rf-content {
        max-width: none;
        padding: 0;
    }

    .rf-card,
    .rf-stat { box-shadow: none; }
}

/* ---------------------------------------------------------------------
   Low-radius geometry and text containment
   ------------------------------------------------------------------ */

/* Geometry belongs to components; avoid overriding every descendant. */

body :is(
    .rf-avatar,
    [class*="-avatar"],
    [class*="-dot"],
    [class*="-pulse"],
    [class*="-spinner"],
    [class*="-ripple"],
    [class*="-ring"],
    [class*="-orb"],
    .rf-sidebar-shape.is-ring,
    .rf-wizard-step-button span,
    .rf-typing span,
    input[type="radio"]
) {
    border-radius: 50% !important;
}

body [class*="-avatar"] img { border-radius: 50% !important; }

.rf-sidebar-decor::after,
.rf-sidebar-shape.is-diamond,
.rf-page-head > div:first-child::before,
.rf-section-heading::before {
    border-radius: 2px !important;
}

.rf-btn:not(.rf-btn-icon),
.rf-wizard-step-button,
.rf-dropdown-item,
.rf-search-item,
.rf-mobile-nav-item {
    max-width: 100%;
    height: auto !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    line-height: 1.25;
    text-align: center;
}

.rf-btn:not(.rf-btn-icon),
.rf-mobile-nav-item { min-width: 0; }

.rf-btn:not(.rf-btn-icon) { padding-top: .58rem; padding-bottom: .58rem; }
.rf-btn-sm:not(.rf-btn-icon) { padding-top: .4rem; padding-bottom: .4rem; }
.rf-btn-lg:not(.rf-btn-icon) { padding-top: .72rem; padding-bottom: .72rem; }
.rf-btn-xl:not(.rf-btn-icon) { padding-top: .85rem; padding-bottom: .85rem; }

.rf-btn-icon,
.rf-icon-btn,
.rf-sidebar-collapse,
.rf-sidebar-search-clear,
.rf-sidebar-search-compact,
.rf-sidebar-signout {
    flex: none;
    white-space: nowrap;
}

.rf-card-head,
.rf-card-body,
.rf-card-foot,
.rf-modal-head,
.rf-modal-body,
.rf-modal-foot,
.rf-alert,
.rf-list-item,
.rf-table-tools,
.rf-filters,
.rf-page-actions {
    min-width: 0;
}

.rf-card-head,
.rf-card-foot,
.rf-modal-head,
.rf-modal-foot,
.rf-alert,
.rf-table-tools,
.rf-filters,
.rf-page-actions { flex-wrap: wrap; }

body :is(h1, h2, h3, h4, h5, h6, p, label, legend, small, strong, span, a, button, li, dt, dd, td, th),
.rf-btn span,
.rf-nav-label,
.rf-sidebar-utilities > a > span,
.rf-badge,
.rf-chip,
.rf-card a,
.rf-modal a,
.rf-alert a {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.rf-nav-label,
.rf-sidebar-utilities > a > span:not(.rf-nav-badge) {
    white-space: normal;
    line-height: 1.3;
}

.rf-nav-section {
    height: auto;
    white-space: normal;
    overflow-wrap: anywhere;
}

.rf-input,
.rf-select,
.rf-textarea,
input,
select,
textarea {
    max-width: 100%;
    line-height: 1.35;
}

.rf-input,
.rf-select,
input,
select {
    overflow: hidden;
    text-overflow: ellipsis;
}

:is(.rf-card, .rf-modal, .rf-dropdown-panel, .rf-focus-drawer, .rf-chat-details) > * {
    min-width: 0;
    max-width: 100%;
}

:is(.rf-card, .rf-modal, .rf-focus-drawer) :is(.rf-card, .rf-stat, .rf-filters, .rf-alert) {
    border-color: var(--interface-line);
    background: var(--interface-panel-muted);
    box-shadow: none;
}

:is(.rf-card, .rf-modal, .rf-focus-drawer) :is(.rf-card, .rf-stat, .rf-filters, .rf-alert):hover {
    box-shadow: none;
    transform: none;
}

:is(.rf-grid, .rf-grid-2, .rf-grid-3, .rf-grid-4, .rf-grid-sidebar, .rf-grid-sidebar-left) > *,
:is(.rf-card-head, .rf-card-body, .rf-card-foot, .rf-modal-head, .rf-modal-body, .rf-modal-foot) > * {
    min-width: 0;
    max-width: 100%;
}

:is(.rf-card, .rf-modal, .rf-alert, .rf-dropdown-panel, .rf-focus-drawer) :is(img, video, canvas, iframe) {
    max-width: 100%;
    height: auto;
}

:is(.rf-card, .rf-modal, .rf-focus-drawer) .rf-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

:is(.rf-card, .rf-modal, .rf-focus-drawer) :is(.rf-btn-group, .rf-page-actions, .rf-card-actions) {
    display: flex;
    max-width: 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

:is(.rf-card, .rf-modal, .rf-focus-drawer) :is(.rf-tabs, .rf-filters) {
    max-width: 100%;
    overflow-x: auto;
}

/* Calm workspace refinements. Visibility utilities must beat component display rules. */
[hidden], .u-hidden { display: none !important; }
.rf-card, .rf-stat, .rf-action-hero, .rf-today-action { border-radius: var(--radius-lg); }
.rf-btn, .rf-icon-btn, .rf-input, .rf-select, .rf-textarea, .rf-search { border-radius: var(--radius); }
.rf-badge, .rf-chip { border-radius: var(--radius-pill); }
.rf-card, .rf-stat { box-shadow: 0 1px 3px rgba(17,17,20,.035); }
.rf-stat::before { display: none; }
/* Studio navigation: graphite frame, white route tab, red brand signature.
   The sidebar deliberately keeps the same palette in both application themes. */
.rf-sidebar {
    --nav-black: #101112;
    --nav-panel: #1a1b1e;
    --nav-raised: #26272b;
    --nav-line: #323338;
    --nav-muted: #9e9fa5;
    --nav-white: #fafafa;
    --nav-red: #e50305;
    background: var(--nav-black);
    border: 1px solid var(--nav-line);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.05);
    isolation: isolate;
}
.rf-sidebar::before, .rf-sidebar::after, .rf-sidebar-decor { display: none !important; }
.rf-sidebar-art {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
    user-select: none;
}
.rf-sidebar-art > svg { display: block; width: 100%; height: 100%; }
.rf-sidebar-art-white rect { fill: var(--nav-white); opacity: .06; }
.rf-sidebar-art-rectangles rect { fill: none; stroke: var(--nav-muted); stroke-width: 1; opacity: .12; }
.rf-sidebar-art-red rect { fill: var(--nav-red); opacity: .15; }
@media (min-width: 901px) {
    :root.rf-sidebar-collapsed .rf-sidebar-art { opacity: .45; }
}
@media (forced-colors: active) {
    .rf-sidebar-art { display: none; }
}
:root .rf-sidebar .rf-sidebar-head {
    min-height: 88px;
    flex-shrink: 0;
    padding-top: 5px;
    background: var(--nav-panel);
    border-color: var(--nav-line);
}
.rf-sidebar-head::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--nav-red) 0 48%, var(--nav-white) 48% 68%, #65666b 68% 84%, var(--nav-raised) 84%);
}
:root .rf-sidebar .rf-sidebar-brand { gap: .65rem; padding: .85rem 3rem .85rem .85rem; }
:root .rf-sidebar .rf-sidebar-logo-tile {
    width: 38px; height: 42px; border: 0; border-radius: 5px 12px 5px 5px;
    background: var(--nav-white); box-shadow: none;
}
:root .rf-sidebar .rf-brand-name { font-size: 1rem; letter-spacing: -.04em; }
:root .rf-sidebar .rf-brand-sub { max-width: 122px; color: var(--nav-muted); font-size: .57rem; letter-spacing: .06em; }
:root .rf-sidebar .rf-sidebar-collapse {
    width: 32px; height: 36px; right: .6rem;
    border: 1px solid var(--nav-line); border-radius: 6px;
    background: var(--nav-black); color: var(--nav-white); box-shadow: none;
    transition: background 160ms ease, border-color 160ms ease;
}
:root .rf-sidebar .rf-sidebar-collapse:hover { background: var(--nav-red); border-color: var(--nav-red); }
:root .rf-sidebar .rf-sidebar-search-panel { padding: .75rem .75rem .25rem; border: 0; background: transparent; }
:root .rf-sidebar .rf-sidebar-search input {
    height: 40px; border: 1px solid var(--nav-line); border-radius: 8px;
    background: var(--nav-panel); font-size: .75rem; color: var(--nav-white);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}
:root .rf-sidebar .rf-sidebar-search input::placeholder { color: var(--nav-muted); }
:root .rf-sidebar .rf-sidebar-search-icon { color: var(--nav-muted); }
:root .rf-sidebar .rf-sidebar-search input:focus { border-color: var(--nav-white); box-shadow: 0 0 0 2px var(--nav-black); }
:root .rf-sidebar .rf-sidebar-search-clear { color: var(--nav-muted); }
:root .rf-sidebar .rf-sidebar-search-clear:hover { color: var(--nav-white); background: var(--nav-raised); }
:root .rf-sidebar .rf-sidebar-nav { padding: .15rem .7rem .75rem; scrollbar-color: #4b4c50 transparent; }
:root .rf-sidebar .rf-nav-group + .rf-nav-group { margin-top: .4rem; }
:root .rf-sidebar .rf-nav-section {
    display: flex; min-height: 36px; margin: .15rem 0; padding: .3rem .45rem; gap: .55rem;
    color: var(--nav-muted); font-size: .6rem; letter-spacing: .12em;
}
.rf-nav-section-number { font-variant-numeric: tabular-nums; font-size: .6rem; letter-spacing: 0; color: var(--nav-muted); }
.rf-nav-section-label { flex: 1; }
:root .rf-sidebar .rf-nav-section > .rf-icon { width: 12px; height: 12px; color: var(--nav-muted); }
:root .rf-sidebar .rf-nav-item {
    position: relative; min-height: 44px; gap: .6rem; margin: 2px 0; padding: .35rem .6rem;
    border: 1px solid transparent; border-radius: 8px; background: transparent;
    color: #c9cace; font-size: .8rem; box-shadow: none;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
:root .rf-sidebar .rf-nav-item:hover { background: var(--nav-raised); border-color: var(--nav-line); color: var(--nav-white); }
:root .rf-sidebar .rf-nav-item .rf-icon {
    width: 30px; height: 30px; padding: 5px; border: 0; border-radius: 5px;
    background: transparent; color: var(--nav-muted); box-shadow: none; transform: none;
    transition: color 160ms ease, background 160ms ease;
}
:root .rf-sidebar .rf-nav-item:hover .rf-icon { color: var(--nav-white); }
:root .rf-sidebar .rf-nav-item.is-active {
    background: var(--nav-white); border-color: var(--nav-white); color: var(--nav-black);
    font-weight: 700; box-shadow: 0 3px 8px rgba(0,0,0,.15);
}
:root .rf-sidebar .rf-nav-item.is-active .rf-nav-label { color: var(--nav-black); }
:root .rf-sidebar .rf-nav-item.is-active .rf-icon { background: var(--nav-red); color: var(--nav-white); }
:root .rf-sidebar .rf-nav-item.is-active::after { display: none; }
:root .rf-sidebar .rf-nav-item.is-active::after { display: none; }
:root .rf-sidebar .rf-nav-badge {
    min-width: 18px; height: 18px; padding: 0 5px;
    background: var(--nav-red); color: var(--nav-white);
    border-radius: 5px; font-size: .6rem; font-variant-numeric: tabular-nums;
}
:root .rf-sidebar .rf-sidebar-foot {
    padding: .5rem .55rem; background: var(--nav-panel);
    border-top: 1px solid var(--nav-line);
}
:root .rf-sidebar .rf-sidebar-utilities {
    padding-bottom: .4rem; margin-bottom: .4rem;
    border-color: var(--nav-line);
}
:root .rf-sidebar .rf-sidebar-utilities > a {
    min-height: 42px; color: var(--nav-muted); border-radius: 7px;
    transition: background 160ms ease, color 160ms ease;
}
:root .rf-sidebar .rf-sidebar-utilities > a:hover { background: var(--nav-raised); color: var(--nav-white); }
:root .rf-sidebar .rf-sidebar-account {
    grid-template-columns: minmax(0,1fr) 34px; padding: .3rem;
    border: 1px solid var(--nav-line); border-radius: 9px;
    background: var(--nav-black); box-shadow: none;
}
:root .rf-sidebar .rf-sidebar-user { gap: .5rem; }
:root .rf-sidebar .rf-su-name { color: var(--nav-white); font-size: .75rem; font-weight: 600; }
:root .rf-sidebar .rf-su-role { color: var(--nav-muted); font-size: .66rem; }
:root .rf-sidebar .rf-avatar { background: var(--nav-raised) !important; color: var(--nav-white); border: 1px solid var(--nav-line); }
:root .rf-sidebar .rf-sidebar-signout { color: var(--nav-muted); border-radius: 7px; }
:root .rf-sidebar .rf-sidebar-signout:hover { color: var(--nav-white); background: var(--nav-red); }
:root .rf-sidebar :is(a, button):focus-visible { outline: 2px solid var(--nav-white); outline-offset: 2px; }
:root .rf-sidebar .rf-nav-item.is-active:focus-visible { outline-color: var(--nav-red); }
@media (min-width: 901px) {
    :root { --sidebar-expanded-width: 248px; }
    :root.rf-sidebar-collapsed .rf-sidebar .rf-sidebar-head { min-height: 108px; }
    :root.rf-sidebar-collapsed .rf-sidebar .rf-sidebar-brand { justify-content: center; padding: .65rem 0 3.2rem; }
    :root.rf-sidebar-collapsed .rf-sidebar .rf-sidebar-collapse { right: 50%; width: 32px; height: 32px; }
    :root.rf-sidebar-collapsed .rf-sidebar .rf-sidebar-search-panel { padding: .55rem .35rem; }
    :root.rf-sidebar-collapsed .rf-sidebar .rf-sidebar-search-compact { width: 44px; height: 44px; border-color: var(--nav-line); background: var(--nav-panel); border-radius: 7px; }
    :root.rf-sidebar-collapsed .rf-sidebar .rf-sidebar-nav { padding: .2rem .35rem .6rem; }
    :root.rf-sidebar-collapsed .rf-sidebar .rf-nav-section { display: none; }
    :root.rf-sidebar-collapsed .rf-sidebar .rf-nav-item { width: 46px; padding: 0; margin: 4px auto; }
    :root.rf-sidebar-collapsed .rf-sidebar .rf-sidebar-foot { padding: .45rem .3rem; }
    :root.rf-sidebar-collapsed .rf-sidebar .rf-sidebar-account { padding: .2rem 0; border: 0; background: transparent; }
}
@media (max-width: 900px) {
    :root .rf-sidebar .rf-sidebar-brand { padding: .85rem 1rem; }
    :root .rf-sidebar .rf-nav-section { min-height: 44px; }
    :root .rf-sidebar .rf-sidebar-search input { height: 44px; font-size: 16px; }
    :root .rf-sidebar .rf-sidebar-account { grid-template-columns: minmax(0,1fr) 44px; }
    :root .rf-sidebar .rf-sidebar-user { width: auto; }
    :root .rf-sidebar .rf-sidebar-signout { width: 44px; height: 44px; }
}
#rf-search-mobile { display: none; }
.rf-avatar-photo { position: relative; color: white; }
.rf-avatar-photo > img { position: absolute; inset: 0; width: 100%; height: 100% !important; object-fit: cover; border-radius: inherit; }
.rf-avatar-photo > .rf-avatar-fallback { font-weight: 650; line-height: 1; }
.rf-notification-groups .rf-notif-list { max-height: none; height: auto; overflow: visible; }
.rf-notification-groups .rf-notif { align-items: flex-start; border: 0; border-bottom: 1px solid var(--border-color); border-radius: 0; padding: 1rem 1.25rem; }
.rf-notification-groups .rf-notif-title, .rf-notification-groups .rf-notif-text { display: block; }
.rf-notification-groups .rf-notif-title { margin: .4rem 0 .25rem; font-weight: 600; }
.rf-notification-groups .rf-notif-text { color: var(--text-secondary); line-height: 1.5; }
.rf-notification-groups .rf-notif.is-unread { background: var(--surface-secondary); }
.rf-notification-groups .rf-notif.is-unread .rf-notif-title::before { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 .45rem .1rem 0; border-radius: 50%; background: var(--primary); }
.rf-notification-groups .rf-notif-meta { flex-wrap: wrap; gap: .5rem; }
.rf-notif-open { align-self: center; flex-shrink: 0; }
.rf-chat-filters { flex-wrap: wrap; overflow: visible; }
.rf-chat-filter { flex: 0 0 auto; white-space: nowrap; }
.rf-auth-card { box-shadow: 0 8px 28px rgba(17,17,20,.09); }
.rf-btn-primary { box-shadow: 0 2px 6px rgba(185,2,4,.1); }
.rf-page-head { margin-bottom: 1.5rem; }
.rf-record-meta { display: block; margin-top: .3rem; color: var(--text-muted); font-size: .78rem; line-height: 1.5; }
.rf-owner-line { display: flex; align-items: center; gap: .5rem; }
.rf-quick-grid { gap: .5rem; }
.rf-quick { box-shadow: none; }
@media (min-width: 901px) {
    .rf-chat-page .rf-sidebar { visibility: visible; transform: none; }
}
@media (max-width: 900px) {
    #rf-search-mobile { display: inline-flex; }
    .rf-chat-filters { flex-wrap: wrap; overflow: visible; }
}
@media (max-width: 600px) {
    .rf-notification-groups .rf-notif { padding: .85rem; gap: .65rem; }
    .rf-notification-groups .rf-notif-open { font-size: 0; }
    .rf-notification-groups .rf-notif-open .rf-icon { width: 18px; height: 18px; }
}

/* Daily work and useful context, with progressive disclosure for detail. */
.rf-workspace-insights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.rf-workspace-insights > .rf-next-up { grid-column: 1 / -1; }
.rf-workspace-insights > :only-child { grid-column: 1 / -1; }
.rf-next-row { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: .8rem; align-items: center; padding: 1rem 1.25rem; }
.rf-next-row + .rf-next-row { border-top: 1px solid var(--border-color); }
.rf-next-row p { margin-bottom: 0; }
.rf-next-row strong { font-size: .9rem; font-weight: 600; }
.rf-next-icon { color: var(--text-secondary); display: grid; place-items: center; }
.rf-next-row.is-urgent .rf-next-icon { color: var(--danger); }
.rf-next-empty { display: flex; gap: .75rem; padding: 1.5rem; align-items: center; color: var(--text-secondary); }
.rf-next-empty > .rf-icon { color: var(--success); }
.rf-metric-grid { display: grid; gap: 1.25rem; }
.rf-context-metric + .rf-context-metric { border-top: 1px solid var(--border-color); padding-top: 1rem; }
.rf-metric-label { display: inline-flex; align-items: center; gap: .4rem; color: var(--text-secondary); font-size: .85rem; font-weight: 550; }
.rf-metric-reading { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: baseline; margin: .35rem 0 .75rem; }
.rf-metric-reading > strong { font-size: 1.8rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.rf-metric-reading > strong small { font-size: .9rem; color: var(--text-muted); margin-left: .25rem; }
.rf-mini-bars { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: .5rem; height: 66px; }
.rf-mini-bars > span { position: relative; display: grid; grid-template-rows: 44px 18px; align-items: end; text-align: center; }
.rf-mini-bars i { display: block; height: max(1px,var(--bar-height)); max-height: 44px; width: 100%; background: var(--border-strong); border-radius: 3px 3px 0 0; }
.rf-mini-bars > span:last-child i { background: var(--primary); }
.rf-mini-bars small { font-size: .65rem; color: var(--text-muted); line-height: 1; }
.rf-metric-details { margin-top: .65rem; font-size: .78rem; color: var(--text-secondary); }
.rf-metric-details summary { cursor: pointer; padding: .3rem 0; }
.rf-metric-details dl { margin: .5rem 0; }
.rf-metric-details dl > div { display: flex; justify-content: space-between; padding: .3rem 0; border-bottom: 1px solid var(--border-color); }
.rf-metric-details dd { margin: 0; font-variant-numeric: tabular-nums; }
.rf-activity-feed { list-style: none; padding: .25rem 1.25rem; margin: 0; }
.rf-activity-feed li { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: .75rem; padding: .85rem 0; }
.rf-activity-feed li + li { border-top: 1px solid var(--border-color); }
.rf-activity-avatar { display: grid; place-items: start center; padding-top: .1rem; color: var(--text-muted); }
.rf-activity-feed strong { font-size: .85rem; font-weight: 600; }
.rf-activity-feed p { font-size: .8rem; color: var(--text-secondary); margin: .2rem 0; line-height: 1.5; }
.rf-placement-reading, .rf-placement-foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.rf-placement-reading strong { font-size: 1.85rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.rf-placement-reading strong small { font-size: .95rem; font-weight: 400; color: var(--text-secondary); }
.rf-placement-progress, .rf-guide-progress { appearance: none; display: block; width: 100%; height: 8px; margin: 1rem 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--surface-sunken); color: var(--primary); }
.rf-placement-progress::-webkit-progress-bar, .rf-guide-progress::-webkit-progress-bar { background: var(--surface-sunken); }
.rf-placement-progress::-webkit-progress-value, .rf-guide-progress::-webkit-progress-value { background: var(--primary); border-radius: 8px; }
.rf-placement-progress::-moz-progress-bar, .rf-guide-progress::-moz-progress-bar { background: var(--primary); }
/* Internship progress: months elapsed plus logbook completeness. */
.rf-intern-progress-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; }
.rf-intern-progress-head strong { font-size: 1.15rem; }
.rf-intern-progress-head span { color: var(--text-secondary); font-size: .85rem; }
.rf-intern-progress .rf-placement-progress { margin: .75rem 0; }
.rf-intern-progress-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0; }
.rf-intern-progress-facts > div { padding: .6rem .7rem; border: 1px solid var(--border-color); border-radius: var(--radius); background: var(--surface-secondary); }
.rf-intern-progress-facts dt { color: var(--text-muted); font-size: .72rem; font-weight: 600; }
.rf-intern-progress-facts dd { margin: .15rem 0 0; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rf-intern-progress-facts .is-attention { border-color: color-mix(in srgb, var(--warning) 45%, var(--border-color)); background: var(--warning-soft); }
.rf-intern-length { margin: 0; padding: .6rem 0; color: var(--text-secondary); font-weight: 600; }
.rf-missed-days { display: flex; flex-wrap: wrap; gap: .5rem; }
.rf-missed-days a { display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: 0 .8rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-pill); color: var(--text-primary); font-size: .85rem; font-weight: 600; text-decoration: none; }
.rf-missed-days a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.rf-guide-card { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; }
.rf-guide-card p { margin-bottom: 0; }
.rf-onboarding-item { display: grid; grid-template-columns: 20px minmax(0,1fr) auto; gap: .85rem; }
.rf-onboarding-item label { cursor: pointer; font-weight: 550; }
.rf-onboarding-item.is-complete label { color: var(--text-secondary); }
.rf-queue-context > summary { padding: 1rem 1.25rem; font-weight: 600; cursor: pointer; }
.rf-workflow-steps { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 1rem; list-style: none; margin: 0 0 1rem; padding: 0; }
.rf-workflow-steps li { display: flex; gap: .65rem; align-items: flex-start; border-top: 2px solid var(--border-color); padding-top: .75rem; }
.rf-workflow-marker { display: grid; place-items: center; width: 24px; height: 24px; flex: none; background: var(--surface-sunken); color: var(--text-secondary); border-radius: 50%; font-size: .75rem; }
.rf-workflow-steps strong { display: block; font-size: .82rem; font-weight: 550; }
.rf-workflow-steps small { display: block; font-size: .72rem; color: var(--text-muted); margin-top: .25rem; }
.rf-workflow-steps .is-current { border-color: var(--primary); }
.rf-workflow-steps .is-current .rf-workflow-marker { background: var(--primary); color: white; }
.rf-workflow-steps .is-current strong { font-weight: 700; }
.rf-workflow-steps .is-recorded .rf-workflow-marker { color: var(--success); }
.rf-workflow-notice { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.rf-document { display: flex; gap: .85rem; align-items: center; padding: .85rem; border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--surface); }
.rf-document + .rf-document { margin-top: .6rem; }
.rf-document-icon { display: grid; place-items: center; flex: none; width: 42px; min-height: 48px; gap: .2rem; color: var(--text-secondary); background: var(--surface-secondary); border-radius: var(--radius); }
.rf-document-icon small { font-size: .55rem; font-weight: 700; }
.rf-document-copy { min-width: 0; flex: 1; }
.rf-document-copy > strong { display: block; overflow-wrap: anywhere; font-size: .85rem; }
.rf-document-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.rf-job-file .rf-document { flex: 1; min-width: 0; }
.rf-job-file { flex-wrap: wrap; }
.rf-bubble .rf-document { color: var(--text-primary); }
.rf-bubble .rf-document-actions { flex-basis: 100%; }
.rf-bubble .rf-document { flex-wrap: wrap; }
@media (max-width: 1100px) {
    .rf-workspace-insights { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 600px) {
    .rf-next-row { grid-template-columns: 24px minmax(0,1fr); padding: 1rem; }
    .rf-next-row > .rf-btn { grid-column: 2; justify-self: start; }
    .rf-guide-card { flex-wrap: wrap; }
    .rf-workflow-steps { grid-template-columns: minmax(0,1fr); }
    .rf-workflow-steps li { border-top: 0; border-left: 2px solid var(--border-color); padding: .25rem 0 .25rem .75rem; }
    .rf-document { flex-wrap: wrap; }
    .rf-document-actions { flex-basis: 100%; }
    .rf-document-actions .rf-btn { flex: 1; }
    .rf-placement-reading strong { font-size: 1.5rem; }
}
@media (pointer: coarse) {
    .rf-document-actions .rf-btn, .rf-metric-details summary, .rf-chat-filter { min-height: 44px; }
}

.rf-activity-feed a { color: var(--text-primary); }
.rf-activity-feed a:hover { color: var(--primary); }
[data-dashboard] .rf-empty { padding: 1.75rem 1rem; min-height: 0; }
.rf-chat-filters .rf-chat-filter { flex: 1 0 calc(33.333% - .4rem); text-align: center; border-radius: var(--radius); }
.rf-auth-card, .rf-auth-box { border-radius: 12px; }

/* Email delivery health (Settings > Email & notifications). */
.rf-email-health { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .5rem; margin: 0; }
.rf-email-health > div { padding: .7rem .8rem; border: 1px solid var(--border-color); border-radius: var(--radius); background: var(--surface-secondary); }
.rf-email-health dt { color: var(--text-muted); font-size: .75rem; font-weight: 600; }
.rf-email-health dd { margin: .2rem 0 0; font-size: 1rem; font-weight: 700; }
.rf-email-health .is-attention { border-color: color-mix(in srgb, var(--warning) 45%, var(--border-color)); background: var(--warning-soft); }

/* =====================================================================
   Layout refinements (2026-09 design review)
   ================================================================== */

/* Filter bars: fields side by side with the buttons level with the
   inputs, so the list starts near the top. Phones still stack them. */
.rf-shell-page .rf-filters { display: flex; flex-wrap: wrap; align-items: flex-end; }
.rf-shell-page .rf-filters > .rf-field { flex: 1 1 180px; min-width: 0; margin: 0; }
.rf-shell-page .rf-filters > .rf-filters-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

/* Figures: four across on laptops and desktops (they dropped to two per
   row at 1280px and below, which is most laptops). */
@media (min-width: 1100px) {
    .rf-shell-page :is(.rf-grid-4, .rf-metric-row):has(> .rf-stat) { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
    .rf-shell-page .rf-grid-4 > .rf-stat:last-child:nth-child(odd) { grid-column: auto; }
}

/* Draft autosave's "Draft saved" note never takes a cell in grid forms. */
.rf-draft-state:empty { display: none; }
.rf-draft-state { grid-column: 1 / -1; justify-self: end; }

/* Buttons in tables stay on one line (they wrapped into tall two-line buttons). */
.rf-shell-page td .rf-btn:not(.rf-btn-icon) { white-space: nowrap !important; overflow-wrap: normal; }
.u-nowrap { white-space: nowrap; }
/* Card header links ("All", "Open") get a finger-sized tap area without moving. */
.rf-shell-page .rf-card-head > .rf-btn-link { min-width: 44px; margin-right: -.5rem; padding-inline: .5rem; justify-content: center; }
/* Native file pickers and sliders are big enough to hit on a phone. */
.rf-shell-page input[type="file"]:not([hidden]) { max-width: 100%; min-height: 44px; color: var(--text-secondary); font: inherit; font-size: .84rem; }
.rf-shell-page input[type="file"]::file-selector-button {
    min-height: 40px; margin-right: .75rem; padding: 0 1rem;
    border: 1px solid var(--interface-line); border-radius: 10px;
    background: var(--surface); color: var(--text-primary); font: inherit; font-weight: 650; cursor: pointer;
}
.rf-shell-page input[type="file"]::file-selector-button:hover { border-color: var(--primary); color: var(--primary); }
.rf-shell-page input.rf-input[type="file"] { height: auto; padding: .2rem .3rem; }
.rf-shell-page input.rf-input[type="file"]::file-selector-button { min-height: 36px; border: 0; background: var(--surface-secondary); }
.rf-shell-page .rf-field input[type="range"] { height: 2.25rem; accent-color: var(--primary); }
/* A button beside a field keeps its size; the field gives way. */
.rf-shell-page .u-flex > :is(.rf-input, .rf-select) + .rf-btn { flex: none; }
.rf-shell-page .u-flex > :is(.rf-input, .rf-select) { min-width: 0; }
/* Email and phone links in details lists: a taller tap area on touch screens. */
@media (pointer: coarse) {
    .rf-content :is(dd, li, td) > a:is([href^="mailto:"], [href^="tel:"]),
    .rf-content dd > a:not([class]) { display: inline-block; padding-block: .65rem; margin-block: -.65rem; }
    .rf-placement-foot .rf-btn-link { min-height: 44px; }
}

/* Today's attendance: the action leads; the live clock is a detail. */
.rf-shell-page .rf-attendance-body > div[style*="height"] { display: none; }   /* old spacer */
.rf-shell-page .rf-attendance-body .rf-att-timer { font-size: 1.75rem; }
.rf-shell-page .rf-attendance-body .rf-att-times { margin: .75rem 0; }
/* Side by side only when the card itself is wide (it also sits in narrow side columns). */
.rf-shell-page .rf-attendance-card { container-type: inline-size; }
@container (min-width: 540px) {
    .rf-shell-page .rf-attendance-body {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
        grid-auto-flow: row dense;
        align-items: center;
        justify-items: start;
        column-gap: 1.5rem;
        row-gap: .3rem;
        padding: 1rem 1.25rem;
        text-align: left;
    }
    .rf-shell-page .rf-attendance-body > :is(.rf-att-state, .rf-att-timer, .rf-att-timer-label) { grid-column: 1; margin: 0; }
    .rf-shell-page .rf-attendance-body > .rf-btn { grid-column: 2; justify-self: stretch; width: 100%; margin: 0; }
    .rf-shell-page .rf-attendance-body > :not(.rf-att-state):not(.rf-att-timer):not(.rf-att-timer-label):not(.rf-btn):not(.rf-modal-backdrop) { grid-column: 1 / -1; justify-self: stretch; }
}
