/* ==========================================================================
   Rednirus Company OS — design system
   Bootstrap 5.3 + custom tokens. Light + dark via [data-bs-theme].
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
    --rn-navy: #07132a;
    --rn-navy-600: #0d1f42;
    --rn-navy-400: #1b3155;
    --rn-teal: #00c6ae;
    --rn-teal-dark: #009e8c;
    --rn-orange: #ff5c1a;
    --rn-gold: #f6c344;
    --rn-blue: #2f6db5;
    --rn-green: #2fa518;
    --rn-red: #e03131;
    --rn-purple: #7048e8;

    --rn-sidebar-w: 268px;
    --rn-sidebar-w-collapsed: 76px;
    --rn-topbar-h: 62px;
    --rn-radius: 14px;
    --rn-radius-sm: 10px;
    --rn-radius-lg: 20px;

    --rn-font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --rn-font-display: 'Plus Jakarta Sans', var(--rn-font-body);

    --rn-transition: 180ms cubic-bezier(.4, 0, .2, 1);
}

[data-bs-theme='light'] {
    --rn-bg: #f4f6fb;
    --rn-surface: #ffffff;
    --rn-surface-2: #f8fafc;
    --rn-border: #e6e9f0;
    --rn-text: #14213d;
    --rn-text-muted: #6b7794;
    --rn-sidebar-bg: #07132a;
    --rn-sidebar-text: #a9b6cf;
    --rn-sidebar-active: rgba(0, 198, 174, .14);
    --rn-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .12);
    --rn-shadow-lg: 0 18px 48px -18px rgba(7, 19, 42, .28);
}

[data-bs-theme='dark'] {
    --rn-bg: #0a1020;
    --rn-surface: #111a2e;
    --rn-surface-2: #16203a;
    --rn-border: #22304d;
    --rn-text: #e6ecf7;
    --rn-text-muted: #8fa0bf;
    --rn-sidebar-bg: #070d1a;
    --rn-sidebar-text: #93a3c2;
    --rn-sidebar-active: rgba(0, 198, 174, .18);
    --rn-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --rn-shadow-lg: 0 18px 48px -18px rgba(0, 0, 0, .8);

    --bs-body-bg: var(--rn-bg);
    --bs-body-color: var(--rn-text);
}

/* ---------- 2. Base ------------------------------------------------------ */
body {
    font-family: var(--rn-font-body);
    background: var(--rn-bg);
    color: var(--rn-text);
    font-size: .9rem;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--rn-font-display);
    font-weight: 700;
    letter-spacing: -.015em;
    color: var(--rn-text);
}

a { text-decoration: none; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rn-border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--rn-text-muted); }

.text-muted { color: var(--rn-text-muted) !important; }

/* ---------- 3. App shell ------------------------------------------------- */
.rn-shell { min-height: 100vh; }

.rn-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rn-sidebar-w);
    background: var(--rn-sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1045;
    transition: width var(--rn-transition), transform var(--rn-transition);
    border-right: 1px solid rgba(255, 255, 255, .05);
}

.rn-sidebar__brand {
    height: var(--rn-topbar-h);
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 0 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    flex-shrink: 0;
}

.rn-sidebar__logo {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--rn-teal), var(--rn-blue));
    display: grid; place-items: center;
    color: #fff; font-weight: 800; font-size: .95rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 198, 174, .35);
}

.rn-sidebar__title {
    color: #fff; font-weight: 700; font-size: .92rem; line-height: 1.15;
    white-space: nowrap;
}
.rn-sidebar__title small { color: var(--rn-sidebar-text); font-weight: 500; font-size: .68rem; }

.rn-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: .75rem .65rem 1.5rem;
}
.rn-sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); }

.rn-nav-header {
    color: rgba(169, 182, 207, .55);
    font-size: .66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    padding: 1rem .8rem .4rem;
    white-space: nowrap;
}

.rn-nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .58rem .8rem;
    border-radius: var(--rn-radius-sm);
    color: var(--rn-sidebar-text);
    font-weight: 500;
    font-size: .855rem;
    transition: var(--rn-transition);
    position: relative;
    white-space: nowrap;
}
.rn-nav-link i:first-child { font-size: 1.02rem; width: 20px; text-align: center; flex-shrink: 0; }
.rn-nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.rn-nav-link.active {
    background: var(--rn-sidebar-active);
    color: #fff;
    font-weight: 600;
}
.rn-nav-link.active::before {
    content: '';
    position: absolute; left: -.65rem; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 20px;
    border-radius: 0 4px 4px 0;
    background: var(--rn-teal);
}
.rn-nav-link.is-disabled { opacity: .42; cursor: not-allowed; }
.rn-nav-link .rn-nav-caret { margin-left: auto; font-size: .75rem; transition: transform var(--rn-transition); }
.rn-nav-link[aria-expanded='true'] .rn-nav-caret { transform: rotate(90deg); }

.rn-nav-sub { padding: .15rem 0 .15rem 1.55rem; }
.rn-nav-sub .rn-nav-link { font-size: .82rem; padding: .45rem .75rem; }

.rn-badge-soon {
    margin-left: auto;
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .05em;
    padding: .16rem .38rem;
    border-radius: 5px;
    background: rgba(246, 195, 68, .16);
    color: var(--rn-gold);
    text-transform: uppercase;
}

/* Collapsed sidebar (desktop) */
body.sidebar-collapsed .rn-sidebar { width: var(--rn-sidebar-w-collapsed); }
body.sidebar-collapsed .rn-sidebar__title,
body.sidebar-collapsed .rn-nav-link span,
body.sidebar-collapsed .rn-nav-caret,
body.sidebar-collapsed .rn-badge-soon,
body.sidebar-collapsed .rn-nav-header { display: none; }
body.sidebar-collapsed .rn-nav-link { justify-content: center; padding: .62rem; }
body.sidebar-collapsed .rn-sidebar__nav .collapse { display: none !important; }
body.sidebar-collapsed .rn-main { margin-left: var(--rn-sidebar-w-collapsed); }
body.sidebar-collapsed .rn-topbar { left: var(--rn-sidebar-w-collapsed); }

.rn-main {
    margin-left: var(--rn-sidebar-w);
    min-height: 100vh;
    transition: margin var(--rn-transition);
    display: flex;
    flex-direction: column;
}

.rn-topbar {
    position: fixed;
    top: 0; right: 0; left: var(--rn-sidebar-w);
    height: var(--rn-topbar-h);
    background: color-mix(in srgb, var(--rn-surface) 88%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--rn-border);
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1.15rem;
    z-index: 1040;
    transition: left var(--rn-transition);
}

.rn-content { padding: calc(var(--rn-topbar-h) + 1.35rem) 1.35rem 2rem; flex: 1; }

.rn-footer {
    padding: .9rem 1.35rem;
    border-top: 1px solid var(--rn-border);
    color: var(--rn-text-muted);
    font-size: .78rem;
}

/* ---------- 4. Topbar bits ---------------------------------------------- */
.rn-icon-btn {
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--rn-text-muted);
    display: grid; place-items: center;
    font-size: 1.05rem;
    transition: var(--rn-transition);
    position: relative;
}
.rn-icon-btn:hover { background: var(--rn-surface-2); color: var(--rn-text); border-color: var(--rn-border); }

.rn-search-trigger {
    display: flex; align-items: center; gap: .6rem;
    min-width: 250px;
    padding: .48rem .8rem;
    border: 1px solid var(--rn-border);
    background: var(--rn-surface-2);
    border-radius: var(--rn-radius-sm);
    color: var(--rn-text-muted);
    font-size: .83rem;
    transition: var(--rn-transition);
}
.rn-search-trigger:hover { border-color: var(--rn-teal); color: var(--rn-text); }
.rn-search-trigger kbd {
    margin-left: auto;
    background: var(--rn-surface);
    border: 1px solid var(--rn-border);
    border-radius: 5px;
    padding: .08rem .34rem;
    font-size: .68rem;
    color: var(--rn-text-muted);
}

.rn-dot {
    position: absolute; top: 7px; right: 8px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--rn-orange);
    border: 2px solid var(--rn-surface);
}

.rn-avatar {
    border-radius: 50%;
    object-fit: cover;
    background: var(--rn-surface-2);
    flex-shrink: 0;
}
.rn-avatar-xs { width: 26px; height: 26px; }
.rn-avatar-sm { width: 34px; height: 34px; }
.rn-avatar-md { width: 44px; height: 44px; }
.rn-avatar-lg { width: 76px; height: 76px; }
.rn-avatar-xl { width: 108px; height: 108px; }

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

/* ---------- 5. Cards & surfaces ------------------------------------------ */
.rn-card {
    background: var(--rn-surface);
    border: 1px solid var(--rn-border);
    border-radius: var(--rn-radius);
    box-shadow: var(--rn-shadow);
    transition: var(--rn-transition);
}
.rn-card--hover:hover { transform: translateY(-2px); box-shadow: var(--rn-shadow-lg); }

.rn-card__head {
    display: flex; align-items: center; gap: .75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--rn-border);
}
.rn-card__title { font-size: .93rem; font-weight: 700; margin: 0; }
.rn-card__body { padding: 1.15rem; }
.rn-card__foot { padding: .8rem 1.15rem; border-top: 1px solid var(--rn-border); }

/* Stat tile */
.rn-stat {
    position: relative;
    overflow: hidden;
    padding: 1.15rem;
}
.rn-stat__label { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--rn-text-muted); }
.rn-stat__value { font-size: 1.85rem; font-weight: 800; line-height: 1.1; margin: .35rem 0 .15rem; letter-spacing: -.02em; }
.rn-stat__icon {
    position: absolute; top: 1rem; right: 1rem;
    width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1.15rem;
}
.rn-stat__trend { font-size: .76rem; font-weight: 600; display: inline-flex; align-items: center; gap: .2rem; }

/* Coloured soft utilities */
.soft-teal    { background: rgba(0, 198, 174, .12);  color: var(--rn-teal-dark); }
.soft-orange  { background: rgba(255, 92, 26, .12);  color: var(--rn-orange); }
.soft-gold    { background: rgba(246, 195, 68, .16); color: #b98a00; }
.soft-blue    { background: rgba(47, 109, 181, .12); color: var(--rn-blue); }
.soft-green   { background: rgba(47, 165, 24, .12);  color: var(--rn-green); }
.soft-red     { background: rgba(224, 49, 49, .12);  color: var(--rn-red); }
.soft-purple  { background: rgba(112, 72, 232, .12); color: var(--rn-purple); }
.soft-navy    { background: rgba(7, 19, 42, .08);    color: var(--rn-navy); }
[data-bs-theme='dark'] .soft-navy { background: rgba(255,255,255,.07); color: #cdd8ee; }
[data-bs-theme='dark'] .soft-gold { color: var(--rn-gold); }

/* ---------- 6. Page header ---------------------------------------------- */
.rn-page-head {
    display: flex; flex-wrap: wrap; align-items: flex-start;
    gap: 1rem; margin-bottom: 1.35rem;
}
.rn-page-head h1 { font-size: 1.42rem; margin: 0; }
.rn-page-head p { margin: .28rem 0 0; color: var(--rn-text-muted); font-size: .855rem; }

.breadcrumb { font-size: .78rem; margin-bottom: .35rem; }
.breadcrumb-item + .breadcrumb-item::before { content: '›'; color: var(--rn-text-muted); }

/* ---------- 7. Buttons --------------------------------------------------- */
.btn { font-weight: 600; font-size: .845rem; border-radius: var(--rn-radius-sm); padding: .5rem .95rem; transition: var(--rn-transition); }
.btn-sm { font-size: .78rem; padding: .34rem .68rem; border-radius: 8px; }
.btn-lg { font-size: .92rem; padding: .68rem 1.3rem; }

.btn-primary {
    background: var(--rn-navy); border-color: var(--rn-navy); color: #fff;
}
.btn-primary:hover, .btn-primary:focus { background: var(--rn-navy-600); border-color: var(--rn-navy-600); color: #fff; }

.btn-accent { background: var(--rn-teal); border-color: var(--rn-teal); color: #04231f; }
.btn-accent:hover { background: var(--rn-teal-dark); border-color: var(--rn-teal-dark); color: #fff; }

.btn-soft {
    background: var(--rn-surface-2);
    border: 1px solid var(--rn-border);
    color: var(--rn-text);
}
.btn-soft:hover { background: var(--rn-border); color: var(--rn-text); }

/* ---------- 8. Forms ----------------------------------------------------- */
.form-label { font-weight: 600; font-size: .795rem; margin-bottom: .35rem; color: var(--rn-text); }
.form-label .req { color: var(--rn-red); }

.form-control, .form-select {
    border-radius: var(--rn-radius-sm);
    border-color: var(--rn-border);
    background: var(--rn-surface);
    color: var(--rn-text);
    font-size: .855rem;
    padding: .5rem .78rem;
    transition: var(--rn-transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--rn-teal);
    box-shadow: 0 0 0 3px rgba(0, 198, 174, .16);
    background: var(--rn-surface);
    color: var(--rn-text);
}
.form-control::placeholder { color: var(--rn-text-muted); opacity: .75; }
.form-text { font-size: .74rem; color: var(--rn-text-muted); }
.input-group-text { background: var(--rn-surface-2); border-color: var(--rn-border); color: var(--rn-text-muted); font-size: .82rem; }

.form-switch .form-check-input:checked { background-color: var(--rn-teal); border-color: var(--rn-teal); }
.form-check-input:checked { background-color: var(--rn-navy); border-color: var(--rn-navy); }
.form-check-label { font-size: .845rem; }

.rn-form-section {
    border-bottom: 1px solid var(--rn-border);
    padding: 1.35rem 0;
}
.rn-form-section:first-child { padding-top: 0; }
.rn-form-section:last-child { border-bottom: 0; padding-bottom: 0; }
.rn-form-section__title { font-size: .87rem; font-weight: 700; margin-bottom: .2rem; }
.rn-form-section__hint { font-size: .78rem; color: var(--rn-text-muted); margin-bottom: 1rem; }

/* ---------- 9. Tables ---------------------------------------------------- */
.rn-table { width: 100%; margin: 0; font-size: .845rem; }
.rn-table thead th {
    background: var(--rn-surface-2);
    color: var(--rn-text-muted);
    font-size: .715rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .7rem .9rem;
    border-bottom: 1px solid var(--rn-border);
    white-space: nowrap;
}
.rn-table thead th.sortable { cursor: pointer; user-select: none; }
.rn-table thead th.sortable:hover { color: var(--rn-text); }
.rn-table tbody td { padding: .72rem .9rem; border-bottom: 1px solid var(--rn-border); vertical-align: middle; color: var(--rn-text); }
.rn-table tbody tr { transition: background var(--rn-transition); }
.rn-table tbody tr:hover { background: var(--rn-surface-2); }
.rn-table tbody tr:last-child td { border-bottom: 0; }
.rn-table .cell-strong { font-weight: 600; }

.table-responsive { border-radius: var(--rn-radius); }

/* Badges */
.badge { font-weight: 600; font-size: .7rem; padding: .32rem .55rem; border-radius: 7px; letter-spacing: .01em; }
.badge-soft-success { background: rgba(47, 165, 24, .13); color: var(--rn-green); }
.badge-soft-danger  { background: rgba(224, 49, 49, .13); color: var(--rn-red); }
.badge-soft-warning { background: rgba(246, 195, 68, .18); color: #b07d00; }
.badge-soft-secondary { background: rgba(107, 119, 148, .14); color: var(--rn-text-muted); }
.badge-soft-info    { background: rgba(47, 109, 181, .13); color: var(--rn-blue); }
[data-bs-theme='dark'] .badge-soft-warning { color: var(--rn-gold); }

/* ---------- 10. Empty state --------------------------------------------- */
.rn-empty { text-align: center; padding: 3.2rem 1rem; }
.rn-empty > i { font-size: 2.6rem; color: var(--rn-text-muted); opacity: .4; }  /* 11.3: direct child only — icons inside action buttons stay normal size */
.rn-empty h6 { margin: .9rem 0 .3rem; font-size: .95rem; }
.rn-empty p { color: var(--rn-text-muted); font-size: .83rem; margin-bottom: 1.1rem; }

/* ---------- 11. Command palette ----------------------------------------- */
.rn-palette-backdrop {
    position: fixed; inset: 0;
    background: rgba(7, 19, 42, .55);
    backdrop-filter: blur(3px);
    z-index: 1080;
    display: grid;
    place-items: start center;
    padding-top: 12vh;
}
.rn-palette {
    width: min(620px, 92vw);
    background: var(--rn-surface);
    border: 1px solid var(--rn-border);
    border-radius: var(--rn-radius-lg);
    box-shadow: var(--rn-shadow-lg);
    overflow: hidden;
}
.rn-palette input {
    border: 0; border-bottom: 1px solid var(--rn-border);
    border-radius: 0; padding: 1rem 1.2rem; font-size: .95rem;
}
.rn-palette input:focus { box-shadow: none; }
.rn-palette__results { max-height: 55vh; overflow-y: auto; padding: .5rem; }
.rn-palette__group { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--rn-text-muted); padding: .6rem .75rem .3rem; }
.rn-palette__item { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 9px; color: var(--rn-text); }
.rn-palette__item:hover { background: var(--rn-surface-2); }
.rn-palette__item small { color: var(--rn-text-muted); }

/* ---------- 12. Org hierarchy tree -------------------------------------- */
.rn-tree, .rn-tree ul { list-style: none; margin: 0; padding-left: 1.4rem; }
.rn-tree > li { padding-left: 0; }
.rn-tree li { position: relative; padding: .3rem 0 .3rem 1.15rem; }
.rn-tree li::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    border-left: 1px dashed var(--rn-border);
}
.rn-tree > li::before { display: none; }
.rn-tree li::after {
    content: ''; position: absolute; left: 0; top: 1.42rem;
    width: 1rem; border-top: 1px dashed var(--rn-border);
}
.rn-tree > li::after { display: none; }
.rn-tree li:last-child::before { bottom: auto; height: 1.42rem; }

.rn-tree-node {
    display: inline-flex; align-items: center; gap: .65rem;
    background: var(--rn-surface);
    border: 1px solid var(--rn-border);
    border-radius: var(--rn-radius-sm);
    padding: .45rem .8rem .45rem .5rem;
    box-shadow: var(--rn-shadow);
    transition: var(--rn-transition);
}
.rn-tree-node:hover { border-color: var(--rn-teal); transform: translateX(2px); }
.rn-tree-node strong { font-size: .845rem; }
.rn-tree-node small { color: var(--rn-text-muted); font-size: .73rem; display: block; }

/* ---------- 13. Permission matrix --------------------------------------- */
.rn-matrix { font-size: .8rem; }
.rn-matrix thead th { position: sticky; top: 0; z-index: 2; }
.rn-matrix th.rn-matrix__row-head {
    position: sticky; left: 0; z-index: 1;
    background: var(--rn-surface);
    text-align: left; font-weight: 600;
    min-width: 210px;
}
.rn-matrix td { text-align: center; }
.rn-module-block { border: 1px solid var(--rn-border); border-radius: var(--rn-radius); overflow: hidden; margin-bottom: 1rem; }
.rn-module-block__head {
    display: flex; align-items: center; gap: .7rem;
    padding: .8rem 1rem;
    background: var(--rn-surface-2);
    cursor: pointer;
}
.rn-perm-group { padding: .85rem 1rem; border-top: 1px solid var(--rn-border); }
.rn-perm-group__title { font-size: .78rem; font-weight: 700; color: var(--rn-text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .6rem; }
.rn-perm-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    border: 1px solid var(--rn-border);
    border-radius: 8px;
    padding: .3rem .6rem;
    margin: 0 .35rem .35rem 0;
    font-size: .77rem;
    cursor: pointer;
    transition: var(--rn-transition);
    background: var(--rn-surface);
}
.rn-perm-chip:hover { border-color: var(--rn-teal); }
.rn-perm-chip input { margin: 0; }
.rn-perm-chip.is-checked { border-color: var(--rn-teal); background: rgba(0, 198, 174, .08); }

/* ---------- 14. Auth pages ---------------------------------------------- */
.rn-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
}
.rn-auth__aside {
    background: linear-gradient(150deg, #07132a 0%, #0d2447 55%, #123a5e 100%);
    color: #fff;
    padding: 3rem;
    display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden;
}
.rn-auth__aside::after {
    content: ''; position: absolute; right: -140px; bottom: -160px;
    width: 460px; height: 460px; border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 198, 174, .3), transparent 68%);
}
.rn-auth__aside::before {
    content: ''; position: absolute; left: -100px; top: -120px;
    width: 340px; height: 340px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 92, 26, .22), transparent 70%);
}
.rn-auth__panel { display: grid; place-items: center; padding: 2.5rem; background: var(--rn-surface); }
.rn-auth__form { width: min(420px, 100%); }
.rn-auth__feature { display: flex; gap: .85rem; margin-bottom: 1.15rem; position: relative; z-index: 1; }
.rn-auth__feature i { color: var(--rn-teal); font-size: 1.15rem; margin-top: .1rem; }
.rn-auth__feature strong { display: block; font-size: .9rem; }
.rn-auth__feature span { color: rgba(255, 255, 255, .68); font-size: .8rem; }

@media (max-width: 991.98px) {
    .rn-auth { grid-template-columns: 1fr; }
    .rn-auth__aside { display: none; }
}

/* ---------- 15. Toasts --------------------------------------------------- */
.rn-toast-wrap { position: fixed; top: 1rem; right: 1rem; z-index: 1090; display: flex; flex-direction: column; gap: .55rem; }
.rn-toast {
    min-width: 290px;
    display: flex; align-items: flex-start; gap: .65rem;
    background: var(--rn-surface);
    border: 1px solid var(--rn-border);
    border-left: 4px solid var(--rn-teal);
    border-radius: var(--rn-radius-sm);
    box-shadow: var(--rn-shadow-lg);
    padding: .8rem .95rem;
    animation: rn-slide-in .28s ease;
    font-size: .845rem;
}
.rn-toast--success { border-left-color: var(--rn-green); }
.rn-toast--error   { border-left-color: var(--rn-red); }
.rn-toast--warning { border-left-color: var(--rn-gold); }
.rn-toast--info    { border-left-color: var(--rn-blue); }

@keyframes rn-slide-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes rn-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.rn-animate { animation: rn-fade-up .32s ease both; }
.rn-animate-1 { animation-delay: .04s; }
.rn-animate-2 { animation-delay: .08s; }
.rn-animate-3 { animation-delay: .12s; }
.rn-animate-4 { animation-delay: .16s; }

/* ---------- 16. Misc ----------------------------------------------------- */
.dropdown-menu {
    border-radius: var(--rn-radius);
    border-color: var(--rn-border);
    box-shadow: var(--rn-shadow-lg);
    background: var(--rn-surface);
    padding: .4rem;
    font-size: .85rem;
}
.dropdown-item { border-radius: 8px; padding: .45rem .7rem; color: var(--rn-text); }
.dropdown-item:hover { background: var(--rn-surface-2); color: var(--rn-text); }
.dropdown-header { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--rn-text-muted); }

.modal-content { border-radius: var(--rn-radius-lg); border-color: var(--rn-border); background: var(--rn-surface); }
.modal-header, .modal-footer { border-color: var(--rn-border); }

.nav-tabs { border-bottom: 1px solid var(--rn-border); gap: .2rem; }
.nav-tabs .nav-link {
    border: 0; border-bottom: 2px solid transparent;
    color: var(--rn-text-muted); font-weight: 600; font-size: .855rem;
    padding: .6rem .95rem; border-radius: 0;
}
.nav-tabs .nav-link:hover { color: var(--rn-text); }
.nav-tabs .nav-link.active { color: var(--rn-teal-dark); border-bottom-color: var(--rn-teal); background: transparent; }
[data-bs-theme='dark'] .nav-tabs .nav-link.active { color: var(--rn-teal); }

.progress { height: 7px; border-radius: 6px; background: var(--rn-surface-2); }
.progress-bar { border-radius: 6px; }

.pagination { --bs-pagination-font-size: .82rem; }
.page-link { border-radius: 8px !important; margin: 0 2px; border-color: var(--rn-border); color: var(--rn-text); background: var(--rn-surface); }
.page-item.active .page-link { background: var(--rn-navy); border-color: var(--rn-navy); }

.rn-divider { height: 1px; background: var(--rn-border); margin: 1.1rem 0; }

.rn-kpi-list { display: flex; flex-direction: column; gap: .85rem; }
.rn-kpi-row { display: flex; align-items: center; gap: .8rem; }
.rn-kpi-row__bar { flex: 1; }

/* Loading state for Livewire */
[wire\:loading] { transition: opacity var(--rn-transition); }
.rn-loading-bar {
    position: fixed; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--rn-teal), var(--rn-orange));
    z-index: 2000;
    animation: rn-indeterminate 1.1s infinite ease-in-out;
    transform-origin: left;
}
@keyframes rn-indeterminate { 0% { transform: scaleX(0); } 50% { transform: scaleX(.7); } 100% { transform: scaleX(1); opacity: 0; } }

/* ---------- 17. Responsive ---------------------------------------------- */
@media (max-width: 991.98px) {
    .rn-sidebar { transform: translateX(-100%); }
    body.sidebar-open .rn-sidebar { transform: none; }
    .rn-main, body.sidebar-collapsed .rn-main { margin-left: 0; }
    .rn-topbar, body.sidebar-collapsed .rn-topbar { left: 0; }
    .rn-search-trigger { min-width: 0; }
    .rn-search-trigger span, .rn-search-trigger kbd { display: none; }
    .rn-content { padding: calc(var(--rn-topbar-h) + 1rem) .85rem 1.5rem; }
    .rn-sidebar-backdrop {
        position: fixed; inset: 0; background: rgba(7, 19, 42, .5); z-index: 1044;
    }
}

@media print {
    .rn-sidebar, .rn-topbar, .rn-footer, .no-print { display: none !important; }
    .rn-main { margin: 0 !important; }
    .rn-content { padding: 0 !important; }
    .rn-card { box-shadow: none; border-color: #ddd; }
}
