/* ==========================================================
   DESIGN TOKENS
========================================================== */

:root {
    /* Brand */
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-soft: #EEF2FF;

    /* Sidebar */
    --sidebar-bg: #0F172A;
    --sidebar-hover: #1E293B;
    --sidebar-text: #d1d5db;
    --sidebar-text-muted: #8b949e;
    --sidebar-text-soft: #cbd5e1;

    /* Surfaces */
    --surface: #FFFFFF;
    --surface-soft: #F8FAFC;

    /* Text */
    --text-dark: #0F172A;
    --text-body: #334155;
    --text-muted: #64748B;
    --text-light: #94A3B8;

    /* Borders */
    --border: #CBD5E1;
    --border-soft: #E5E7EB;
    --border-table: #E2E8F0;

    /* States */
    --danger: #DC2626;
    --danger-hover: #B91C1C;
    --success: #059669;
    --success-hover: #047857;
    --warning: #D97706;
    --warning-hover: #B45309;

    /* Radius */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --radius-xs: 8px;

    /* Shadows */
    --shadow-card:
        0 2px 6px rgba(15, 23, 42, .04),
        0 12px 24px rgba(15, 23, 42, .06);

    --shadow-header: 0 1px 3px rgba(15, 23, 42, .12);

    --shadow-modal:
        0 20px 40px rgba(15, 23, 42, .18);
}

/* ==========================================================
   LAYOUT
========================================================== */

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

.app-layout {
    display: flex;
    height: 100vh;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: var(--surface-soft);
    min-height: 0;
}

.footer {
    flex-shrink: 0;
    padding: 15px 20px;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--border-soft);
    background: var(--surface);
}

/* ==========================================================
   SIDEBAR
========================================================== */

.sidebar {
    width: 270px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.sidebar-brand small {
    color: var(--text-light);
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.menu-title {
    display: block;
    color: var(--sidebar-text-muted);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border-radius: var(--radius-xs);
    text-decoration: none;
    transition: .2s;
    width: 100%;
    border: none;
    background: none;
}

.sidebar .nav-link span {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: white;
}

.sidebar .nav-link.active {
    background: var(--primary);
    color: white;
}

.sidebar .nav-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

/* ==========================================================
   SUBMENU
========================================================== */

.submenu {
    list-style: none;
    padding-left: 30px;
    margin: 6px 0 10px;
}

.submenu li {
    margin: 5px 0;
}

.submenu a {
    color: var(--sidebar-text-soft);
    text-decoration: none;
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    transition: .2s;
}

.submenu a:hover {
    background: rgba(255, 255, 255, .08);
    color: white;
}

.submenu a.active {
    color: white;
    background: rgba(79, 70, 229, .35);
}

.submenu a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.arrow {
    font-size: .8rem;
    transition: transform .25s ease;
}

.nav-collapse:not(.collapsed) .arrow {
    transform: rotate(180deg);
}

/* ==========================================================
   HEADER
========================================================== */

.header {
    height: 60px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 20px;
    flex-shrink: 0;
    box-shadow: var(--shadow-header);
    position: relative;
    z-index: 3;
}

/* ==========================================================
   BREADCRUMB
========================================================== */

.breadcrumb {
    font-size: .85rem;
}

.breadcrumb-item a {
    color: var(--primary);
}

.breadcrumb-item a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ==========================================================
   RHM CARD
========================================================== */

.rhm-card {
    border: none;
    border-top: 3px solid var(--primary);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: visible;
    position: relative;
    box-shadow: var(--shadow-card);
}

.rhm-card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-soft);
    padding: 18px 22px;
}

.rhm-card .card-body {
    padding: 24px;
}

/* ==========================================================
   RHM TABLE
========================================================== */

.rhm-table-wrapper {
    overflow: visible;
    position: relative;
}

@media(max-width:992px) {
    .rhm-table-wrapper {
        overflow-x: auto;
    }
}

.rhm-table-wrapper table {
    width: 100%;
    margin-bottom: 0;
}

.rhm-table-wrapper thead th {
    position: sticky;
    top: 0;
    z-index: 2;

    background: var(--surface-soft);
    color: #475569;
    font-size: .84rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border-table);
    padding: 15px 12px;
}

.rhm-table-wrapper tbody td {
    padding: 15px 12px;
    color: var(--text-body);
    border-color: #F1F5F9;
}

.rhm-table-wrapper tbody tr {
    transition: background .15s ease;
}

.rhm-table-wrapper tbody tr:hover {
    background: var(--surface-soft);
}

/* ==========================================================
   DROPDOWNS
========================================================== */

.dropdown-menu {
    border: none;
    border-radius: var(--radius-md);
    padding: 6px;
    min-width: 180px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .15);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: .65rem .8rem;
    border-radius: var(--radius-xs);
}

.dropdown-item:hover {
    background: var(--primary-soft);
}

.dropdown-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

/* Action Button */

.rhm-action-drop {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    transition: .2s;

}

.rhm-action-drop:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.rhm-action-drop:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ==========================================================
   DATATABLES
========================================================== */

div.dt-container {
    margin-top: 0;
}

div.dt-container .dt-search input {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    background: var(--surface);
}

div.dt-container .dt-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .15);
    outline: none;
}

div.dt-container .dt-length select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 30px 6px 10px;
}

div.dt-container .dt-info {
    color: var(--text-muted);
}

div.dt-container .dt-paging .dt-paging-button {
    border-radius: var(--radius-xs) !important;
    margin: 0 2px;
    border: 1px solid transparent !important;
}

div.dt-container .dt-paging .dt-paging-button.current {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

div.dt-container .dt-paging .dt-paging-button:hover {
    background: var(--primary-soft) !important;
    color: var(--primary-hover) !important;
}

/* ==========================================================
   MODAL
========================================================== */

.rhm-modal {
    border: none;
    border-top: 3px solid var(--primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-modal);
}

.rhm-modal .modal-header {
    border-bottom: 1px solid var(--border-soft);
    padding: 18px 22px;
}

.rhm-modal .modal-title {
    font-weight: 600;
    color: var(--text-dark);
}

.rhm-modal .modal-body {
    padding: 22px;
}

.rhm-modal .modal-footer {
    border-top: 1px solid var(--border-soft);
    padding: 16px 22px;
}

.rhm-modal .btn-close {
    opacity: .55;
    transition: .2s;
}

.rhm-modal .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.rhm-modal .btn-close:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ==========================================================
   FORM SYSTEM
========================================================== */

.row.mb-4 {
    margin-bottom: 1.35rem !important;
}

.form-label {
    font-weight: 600;
    color: var(--text-body);
    margin-bottom: .45rem;
    font-size: .92rem;
}

.form-control,
.form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .7rem .95rem;
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.form-control:hover,
.form-select:hover {
    border-color: var(--text-light);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .15);
}

.form-control::placeholder {
    color: var(--text-light);
}

.form-control[readonly] {
    background: var(--surface-soft);
    color: var(--text-muted);
}

.form-select {
    background-position: right .9rem center;
}

.form-text.text-danger {
    font-size: .82rem;
    font-weight: 500;
    margin-top: .35rem;
}

.form-check {
    margin-bottom: .65rem;
}

.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

.form-check-input:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: none;
}

.form-check-label {
    margin-left: .35rem;
    cursor: pointer;
    color: var(--text-body);
}

/* ==========================================================
   BUTTONS
========================================================== */

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-primary:focus-visible {
    outline: 2px solid var(--text-dark);
    outline-offset: 2px;
}

/* Bootstrap's default .btn-success ships a different green than
   our --success token. Overriding it here keeps "New role" and any
   other success-state UI (badges, toasts) visually consistent. */
.btn-success {
    background: var(--success);
    border-color: var(--success);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.btn-success:hover {
    background: var(--success-hover);
    border-color: var(--success-hover);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.btn-danger:hover {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
}

.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    border-radius: var(--radius-sm);
    font-weight: 500;
    color: white;
}

.btn-warning:hover {
    background: var(--warning-hover);
    border-color: var(--warning-hover);
    color: white;
}

/* ==========================================================
   ACCESSIBILITY
========================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media(max-width:768px) {
    .rhm-modal .modal-body {
        padding: 18px;
    }
}

/* ==========================================================
   ADMIN PREVIEW WATERMARK
========================================================== */
.document-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 3rem;
    font-weight: bold;
    color: rgba(120, 120, 120, .15);

    transform: rotate(-35deg);

    pointer-events: none;
    user-select: none;

    z-index: 10;
}

/* ==========================================================
   DOCUMENT PAGE IMAGE 
========================================================== */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

/* Zoom controls */
#documentViewerModal .btn-outline-secondary {
    border-color: var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-xs);
    transition: .2s;
}

#documentViewerModal .btn-outline-secondary:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary-soft);
}

#documentViewerModal .btn-outline-secondary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

#zoomLevelDisplay {
    color: var(--text-body);
    font-size: .9rem;
    transition: color .15s ease;
}

#zoomLevelDisplay:hover {
    color: var(--primary);
}

#pageImage {
    transform-origin: top center;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
}

#pageImage.is-loading {
    opacity: 0.25;
}

#pageLoadingSpinner .spinner-border {
    color: var(--primary) !important;
}

#pageIndicator {
    color: var(--text-body);
    font-weight: 600;
}

#documentViewerModal .btn-secondary:disabled,
#documentViewerModal .btn-primary:disabled {
    background: var(--border-soft);
    border-color: var(--border-soft);
    color: var(--text-light);
    opacity: 1;
}

/* ==========================================================
   PUBLIC LANDING PAGE
   Added for RHM Marketing Homepage
   Uses the same design tokens above.
========================================================== */

body.public-page{
    background: var(--surface-soft);
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: 82px;
}

/* ---------- Public Navbar ---------- */

.rhm-navbar{
    position: fixed;
    top:0;
    left:0;
    right:0;
    z-index:1050;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
    border-bottom:1px solid var(--border-soft);
    box-shadow: var(--shadow-header);
}

.rhm-navbar .navbar-brand{
    text-decoration:none;
    color: var(--text-dark);
}

.rhm-navbar .navbar-brand small{
    color: var(--text-muted);
    line-height:1;
}

.logo-box{
    width:44px;
    height:44px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg,#6D28D9,var(--primary));
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:1.25rem;
    box-shadow:0 8px 20px rgba(79,70,229,.25);
}

.rhm-navbar .nav-link{
    color: var(--text-body);
    font-weight:500;
    transition:.2s;
}

.rhm-navbar .nav-link:hover{
    color: var(--primary);
}

/* ---------- Hero ---------- */

.hero{
    position:relative;
    padding:120px 0 90px;
    background:
        radial-gradient(circle at top right, rgba(109,40,217,.25), transparent 35%),
        radial-gradient(circle at bottom left, rgba(79,70,229,.18), transparent 35%),
        linear-gradient(135deg,#0F172A,#2E1065);
    color:white;
    overflow:hidden;
}

.hero::before{
    content:"";
    position:absolute;
    inset:0;
    background:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size:40px 40px;
    opacity:.25;
}

.hero .container{
    position:relative;
    z-index:1;
}

.hero-badge{
    display:inline-block;
    padding:8px 16px;
    border-radius:999px;
    background:rgba(255,255,255,.08);
    border:1px solid rgba(255,255,255,.12);
    font-size:.9rem;
}

.hero .lead{
    color:#dbeafe;
}

.hero-image{
    border-radius:26px;
    box-shadow:0 30px 60px rgba(0,0,0,.35);
    animation:heroFloat 6s ease-in-out infinite;
}

@keyframes heroFloat{
    0%,100%{transform:translateY(0);}
    50%{transform:translateY(-8px);}
}

.hero-stats{
    margin-top:45px;
}

.hero-stat h3{
    font-weight:700;
    margin-bottom:4px;
}

.hero-stat small{
    color:#cbd5e1;
}

/* ---------- Generic Section ---------- */

.section{
    padding:90px 0;
}

.section-title{
    text-align:center;
    margin-bottom:55px;
}

.section-title h2{
    color:var(--text-dark);
    font-weight:700;
}

.section-title p{
    color:var(--text-muted);
}

/* ---------- Feature Cards ---------- */

.feature-card{
    background:var(--surface);
    border-radius:22px;
    padding:35px 28px;
    text-align:center;
    box-shadow:var(--shadow-card);
    transition:.3s ease;
    height:100%;
}

.feature-card:hover{
    transform:translateY(-8px);
}

.feature-card i{
    font-size:42px;
    color:var(--primary);
    margin-bottom:18px;
}

.feature-card p{
    color:var(--text-muted);
}

/* ---------- Resource Cards ---------- */

.resource-card{
    background:var(--surface);
    border-radius:22px;
    overflow:hidden;
    box-shadow:var(--shadow-card);
    transition:.3s;
    height:100%;
}

.resource-card:hover{
    transform:translateY(-8px);
}

.resource-preview{
    height:220px;
    background:linear-gradient(135deg,#EEF2FF,#DDD6FE);
    display:flex;
    align-items:center;
    justify-content:center;
}

.resource-preview i{
    font-size:72px;
    color:var(--primary);
}

.resource-card h5{
    color:var(--text-dark);
}

/* ---------- How It Works ---------- */

.step-card{
    background:var(--surface);
    border-radius:22px;
    padding:35px;
    text-align:center;
    box-shadow:var(--shadow-card);
    position:relative;
}

.step-card::after{
    content:"";
    position:absolute;
    width:42px;
    height:42px;
    border-radius:50%;
    background:var(--primary-soft);
    top:-12px;
    left:50%;
    transform:translateX(-50%);
}

.step-card i{
    position:relative;
    z-index:2;
    font-size:34px;
    color:var(--primary);
    margin-bottom:18px;
}

/* ---------- Pricing ---------- */

.pricing-card{
    background:var(--surface);
    border-radius:24px;
    padding:40px 35px;
    text-align:center;
    box-shadow:var(--shadow-card);
}

.pricing-card.featured{
    border:2px solid var(--primary);
    position:relative;
}

.pricing-card.featured::before{
    content:"Most Popular";
    position:absolute;
    top:-14px;
    left:50%;
    transform:translateX(-50%);
    background:var(--primary);
    color:white;
    padding:6px 16px;
    border-radius:999px;
    font-size:.8rem;
    font-weight:600;
}

/* ==========================================================
   PAYMENT OPTIONS
========================================================== */

.price-placeholder h2{
    color:var(--primary);
    font-weight:700;
}

.payment-option{
    display:flex;
    align-items:center;
    gap:16px;
    padding:16px;
    border:1px solid var(--border-soft);
    border-radius:var(--radius-md);
    background:var(--surface);
    transition:.25s ease;
}

.payment-option:hover{
    border-color:var(--primary);
    background:var(--primary-soft);
}

.payment-icon{
    width:52px;
    height:52px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--primary-soft);
    color:var(--primary);
    font-size:1.3rem;
    flex-shrink:0;
}

.process-list li{
    padding:8px 0;
    color:var(--text-body);
}

/* ---------- FAQ ---------- */

.accordion-item{
    border:none;
    border-radius:18px !important;
    overflow:hidden;
    box-shadow:var(--shadow-card);
    margin-bottom:16px;
}

.accordion-button{
    font-weight:600;
    padding:20px;
}

.accordion-button:not(.collapsed){
    background:var(--primary-soft);
    color:var(--primary);
    box-shadow:none;
}

.accordion-button:focus{
    box-shadow:0 0 0 .2rem rgba(79,70,229,.15);
}

/* ---------- CTA ---------- */

.cta{
    padding:100px 0;
    background:linear-gradient(135deg,var(--primary),#6D28D9);
    color:white;
    text-align:center;
}

.cta h2{
    font-weight:700;
}

.cta p{
    color:#EDE9FE;
}

/* ---------- Public Footer ---------- */

.public-footer{
    background:#0F172A;
    color:#CBD5E1;
    padding:70px 0 30px;
}

.public-footer h4,
.public-footer h5{
    color:white;
}

.public-footer ul{
    list-style:none;
    padding:0;
}

.public-footer li{
    margin:10px 0;
}

.public-footer a{
    color:#CBD5E1;
    text-decoration:none;
    transition:.2s;
}

.public-footer a:hover{
    color:white;
}

/* ---------- Utilities ---------- */

.bg-soft{
    background:var(--surface-soft);
}

.shadow-hover{
    transition:.25s;
}

.shadow-hover:hover{
    transform:translateY(-6px);
}

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

@media(max-width:992px){

    .hero{
        text-align:center;
        padding:100px 0 70px;
    }

    .hero-image{
        margin-top:40px;
    }

    .section{
        padding:70px 0;
    }
}

@media(max-width:768px){

    body.public-page{
        padding-top:74px;
    }

    .hero h1{
        font-size:2.2rem;
    }

    .feature-card,
    .step-card,
    .pricing-card{
        padding:28px;
    }
}

/* ==========================================================
   HERO CAROUSEL
========================================================== */

.hero-carousel{
    position:relative;
}

.hero-carousel .carousel-inner{
    border-radius:26px;
    overflow:hidden;
}

.hero-carousel .hero-image{
    width:100%;
    height:560px;
    object-fit:contain;
    background:transparent;
    padding:10px;
}

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next{
    width:42px;
    height:42px;
    top:50%;
    transform:translateY(-50%);
    background:rgba(15,23,42,.45);
    border-radius:50%;
    opacity:0;
    transition:.25s ease;
}

.hero-carousel .carousel-control-prev{
    left:18px;
}

.hero-carousel .carousel-control-next{
    right:18px;
}

.hero-carousel:hover .carousel-control-prev,
.hero-carousel:hover .carousel-control-next{
    opacity:1;
}

.hero-carousel .carousel-indicators{
    margin-bottom:14px;
}

.hero-carousel .carousel-indicators button{
    width:10px;
    height:10px;
    border-radius:50%;
    background:rgba(255,255,255,.5);
    border:none;
}

.hero-carousel .carousel-indicators .active{
    background:white;
    transform:scale(1.2);
}

@media(max-width:992px){

    .hero-carousel .hero-image{
        height:380px;
    }

}

/* ==========================================================
   AUTH PAGES
========================================================== */

body.auth-body{
    margin:0;
    background:var(--surface-soft);
    overflow:hidden;
}

.auth-page{
    height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
}

.auth-wrapper{
    width:100%;
    max-width:1200px;
    background:var(--surface);
    border-radius:28px;
    overflow:hidden;
    box-shadow:0 25px 60px rgba(15,23,42,.12);
}

.auth-illustration{
    background:
        radial-gradient(circle at top right, rgba(109,40,217,.25), transparent 35%),
        linear-gradient(135deg,#0F172A,#2E1065);
    color:white;
    padding:50px;
    position:relative;
}

.auth-illustration-content{
    display:flex;
    flex-direction:column;
    justify-content:center;
    height:100%;
}

.auth-brand{
    display:flex;
    align-items:center;
    gap:14px;
    margin-bottom:40px;
}

.auth-brand h3{
    margin:0;
    font-weight:700;
}

.auth-brand p{
    margin:0;
    color:#cbd5e1;
}

.auth-illustration h1{
    font-size:2.6rem;
    font-weight:700;
    margin-bottom:18px;
}

.auth-illustration p{
    color:#dbeafe;
    line-height:1.7;
}

.auth-card{
    padding:50px;
}

.auth-card h2{
    font-weight:700;
    color:var(--text-dark);
}

.auth-link{
    color:var(--primary);
    text-decoration:none;
}

.auth-link:hover{
    color:var(--primary-hover);
}

/* Home button */

.auth-home-btn{
    position:fixed;
    top:24px;
    left:24px;
    z-index:1100;

    display:inline-flex;
    align-items:center;
    gap:10px;

    padding:10px 18px;

    background:rgba(255,255,255,.92);
    color:var(--text-dark);

    text-decoration:none;
    font-weight:600;

    border:1px solid var(--border-soft);
    border-radius:999px;

    box-shadow:0 8px 20px rgba(15,23,42,.08);
    backdrop-filter:blur(10px);

    transition:.25s ease;
}

.auth-home-btn:hover{
    background:var(--primary);
    color:white;
    border-color:var(--primary);
    transform:translateY(-2px);
}

.auth-home-btn i{
    font-size:.95rem;
}

/* Carousel */

#authCarousel .carousel-inner{
    border-radius:22px;
    overflow:hidden;
}

#authCarousel .auth-image{
    width:100%;
    height:420px;
    object-fit:contain;
    padding:10px;
}

#authCarousel .carousel-indicators{
    margin-bottom:-10px;
}

@media(max-width:991px){

    body.auth-body{
        overflow:auto;
    }

    .auth-page{
        height:auto;
        min-height:100vh;
        padding:20px;
    }

    .auth-card{
        padding:32px 26px;
    }

    .auth-illustration{
        padding:35px;
    }

    .auth-home-btn{
        top:16px;
        left:16px;
        padding:9px 16px;
    }

}

#bookmarksPanel {
    z-index: 1060;
}

/* ==========================================================
   STUDENT DASHBOARD
========================================================== */

.dash {
    --dash-primary-soft: var(--primary-soft);
    --dash-success-soft: #ECFDF5;
    --dash-warning-soft: #FFFBEB;
    --dash-danger-soft: #FEF2F2;
}

/* ---------- Greeting ---------- */

.dash-greeting {
    margin-bottom: 1.5rem;
}

.dash-greeting h4 {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: .25rem;
}

.dash-greeting p {
    color: var(--text-muted);
    margin: 0;
}

/* ---------- Stat cards ---------- */

.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.dash-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    transition: border-color .2s ease, transform .2s ease;
}

.dash-stat:hover {
    border-color: var(--border);
    transform: translateY(-2px);
}

.dash-stat-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.dash-stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-dark);
    margin: 4px 0 2px;
}

.dash-stat-hint {
    font-size: .8rem;
    color: var(--text-light);
}

.dash-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.dash-stat--primary .dash-stat-icon { background: var(--dash-primary-soft); color: var(--primary); }
.dash-stat--warning .dash-stat-icon { background: var(--dash-warning-soft); color: var(--warning); }
.dash-stat--success .dash-stat-icon { background: var(--dash-success-soft); color: var(--success); }
.dash-stat--danger  .dash-stat-icon { background: var(--dash-danger-soft);  color: var(--danger); }

.dash-stat--danger .dash-stat-value {
    color: var(--danger);
}

/* ---------- Panels ---------- */

.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 16px;
}

.dash-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
}

.dash-panel--wide {
    grid-column: 1 / -1;
}

.dash-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
}

.dash-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-dark);
}

.dash-panel-title i {
    color: var(--primary);
}

.dash-panel-body {
    flex: 1;
    padding: 6px 20px 20px;
}

.dash-link {
    font-size: .85rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.dash-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ---------- List rows ---------- */

.dash-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-soft);
}

.dash-item:last-of-type {
    border-bottom: none;
}

.dash-item-title {
    font-weight: 600;
    color: var(--text-dark);
}

.dash-item-meta {
    font-size: .82rem;
    color: var(--text-muted);
}

/* ---------- Pills ---------- */

.dash-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}

.dash-pill--success { background: var(--dash-success-soft); color: var(--success); }
.dash-pill--warning { background: var(--dash-warning-soft); color: var(--warning); }
.dash-pill--danger  { background: var(--dash-danger-soft);  color: var(--danger); }

/* ---------- Empty state ---------- */

.dash-empty {
    text-align: center;
    padding: 28px 12px 8px;
    color: var(--text-muted);
}

.dash-empty i {
    display: block;
    font-size: 1.8rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.dash-empty p {
    margin-bottom: 12px;
}

/* ---------- Notice ---------- */

.dash-notice {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--dash-primary-soft);
    border-radius: var(--radius-xs);
    color: var(--text-body);
    font-size: .85rem;
}

.dash-notice i {
    color: var(--primary);
    margin-top: 2px;
}

/* ---------- Library tiles ---------- */

.dash-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    padding-top: 16px;
}

.dash-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.dash-tile:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-card);
    transform: translateY(-2px);
}

.dash-tile-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dash-primary-soft);
    color: var(--primary);
    flex-shrink: 0;
}

.dash-tile-title {
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-dark);
}

.dash-tile-type {
    font-size: .78rem;
    color: var(--text-muted);
}

@media (max-width: 992px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Payment methods ---------- */

.dash-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.dash-pay {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-soft);
}

.dash-pay-list .dash-pay:last-child {
    border-bottom: none;
}

.dash-pay-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dash-primary-soft);
    color: var(--primary);
    flex-shrink: 0;
}

.dash-pay-name {
    font-weight: 700;
    color: var(--text-dark);
}

.dash-pay-label {
    font-size: .75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: 2px;
}

.dash-pay-number {
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--text-body);
    font-variant-numeric: tabular-nums;
}

.dash-pay-meta {
    font-size: .8rem;
    color: var(--text-muted);
}

.dash-copy {
    margin-left: auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    cursor: pointer;
    transition: .2s;
    flex-shrink: 0;
}

.dash-copy:hover {
    background: var(--primary-soft);
    border-color: var(--primary-soft);
    color: var(--primary);
}

.dash-copy:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ---------- Staff dashboard additions ---------- */

a.dash-stat {
    text-decoration: none;
    color: inherit;
}

.dash-pill--muted {
    background: var(--surface-soft);
    color: var(--text-muted);
    border: 1px solid var(--border-soft);
}

.dash-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dash-primary-soft);
    color: var(--primary);
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.dash-amount {
    font-weight: 700;
    color: var(--text-dark);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ==========================================================
   RHM AUTHENTICATION — VERTICAL SCROLL FIX
   ========================================================== */

html:has(body.auth-body) {
    height: auto !important;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

body.auth-body {
    height: auto !important;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

body.auth-body .auth-page {
    height: auto !important;
    min-height: 100vh;
    align-items: flex-start;
    overflow: visible;
    padding: 80px 24px 30px;
    box-sizing: border-box;
}

body.auth-body .auth-wrapper {
    flex-shrink: 0;
    margin: 0 auto;
}

@media (max-width: 991px) {
    body.auth-body .auth-page {
        padding: 80px 16px 24px;
    }
}

@media (max-width: 576px) {
    body.auth-body .auth-page {
        padding: 76px 12px 20px;
    }

    body.auth-body .auth-card {
        padding: 24px 18px;
    }
}


/* ==========================================================
   RESPONSIVE SIDEBAR / MOBILE OFF-CANVAS MENU
   ========================================================== */

.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

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

.sidebar-backdrop {
    display: none;
}

/* Tablet and mobile */
@media (max-width: 991.98px) {
    .app-layout {
        position: relative;
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(280px, 85vw);
        height: 100vh;
        height: 100dvh;
        z-index: 1060;
        overflow: hidden;
        transform: translateX(-100%);
        visibility: hidden;
        transition:
            transform 0.25s ease,
            visibility 0.25s ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1050;
        background: rgba(15, 23, 42, 0.55);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition:
            opacity 0.25s ease,
            visibility 0.25s ease;
    }

    .sidebar-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .sidebar-toggle {
        display: inline-flex;
        margin-right: auto;
    }

    .header {
        justify-content: flex-end;
        gap: 12px;
        padding: 0 14px;
    }

    .main-wrapper {
        width: 100%;
        min-width: 0;
    }

    .content-area {
        min-width: 0;
        padding: 18px 14px;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar-backdrop {
        transition: none;
    }
}


/* ==========================================================
   RHM SIDEBAR — DESKTOP COLLAPSE
   ========================================================== */

@media (min-width: 992px) {
    .app-layout .sidebar {
        position: relative;
        flex: 0 0 270px;
        width: 270px;
        min-width: 0;
        overflow: hidden;
        transition:
            width 0.25s ease,
            flex-basis 0.25s ease;
    }

    .app-layout .main-wrapper {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Collapsed icon-only sidebar */
    .app-layout.sidebar-collapsed .sidebar {
        flex-basis: 76px;
        width: 76px;
    }

    .app-layout.sidebar-collapsed .sidebar-brand {
        justify-content: center;
        gap: 0;
        padding: 18px 8px;
    }

    /* Hide the brand text while keeping the logo */
    .app-layout.sidebar-collapsed .sidebar-brand > div:not(.brand-logo) {
        display: none;
    }

    .app-layout.sidebar-collapsed .sidebar-menu {
        padding: 15px 8px;
        overflow-x: hidden;
    }

    .app-layout.sidebar-collapsed .menu-title {
        display: none;
    }

    /* Center navigation icons */
    .app-layout.sidebar-collapsed .sidebar .nav-link {
        justify-content: center;
        gap: 0;
        padding: 12px 8px;
        white-space: nowrap;
    }

    /* Hide text while retaining icons inside the link */
    .app-layout.sidebar-collapsed .sidebar .nav-link span {
        justify-content: center;
        gap: 0;
        font-size: 0;
    }

    .app-layout.sidebar-collapsed .sidebar .nav-link span i {
        font-size: 1rem;
    }

    .app-layout.sidebar-collapsed .sidebar .nav-link .arrow {
        display: none;
    }

    /* Submenus are accessed after expanding the sidebar */
    .app-layout.sidebar-collapsed .sidebar .submenu,
    .app-layout.sidebar-collapsed .sidebar .nav-collapse + .submenu {
        display: none !important;
    }

    /* Tooltip for icon-only navigation */
    .app-layout.sidebar-collapsed .sidebar [data-sidebar-tooltip] {
        position: relative;
    }

    .app-layout.sidebar-collapsed .sidebar [data-sidebar-tooltip]::after {
        content: attr(data-sidebar-tooltip);
        position: absolute;
        left: calc(100% + 12px);
        top: 50%;
        transform: translateY(-50%);
        z-index: 1080;
        padding: 8px 12px;
        border-radius: 7px;
        background: #0F172A;
        color: #fff;
        font-size: 0.82rem;
        font-weight: 500;
        line-height: 1.3;
        white-space: nowrap;
        box-shadow: 0 5px 18px rgba(0, 0, 0, 0.2);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .app-layout.sidebar-collapsed
    .sidebar [data-sidebar-tooltip]:hover::after,
    .app-layout.sidebar-collapsed
    .sidebar [data-sidebar-tooltip]:focus-visible::after {
        opacity: 1;
        visibility: visible;
    }

    /* Header toggle is visible on desktop too */
    .header .sidebar-toggle {
        display: inline-flex;
        margin-right: auto;
    }

    .sidebar-backdrop {
        display: none !important;
    }
}

/* Keep mobile off-canvas behavior separate */
@media (max-width: 991.98px) {
    .app-layout .sidebar {
        flex: initial;
    }

    .app-layout.sidebar-collapsed .sidebar {
        width: min(280px, 85vw);
    }
}

/* Respect reduced-motion settings */
@media (prefers-reduced-motion: reduce) {
    .app-layout .sidebar {
        transition: none;
    }
}