:root {
    --rm-font-sans: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    --rm-bg: #f3f7ff;
    --rm-bg-soft: #f8fbff;
    --rm-surface: #ffffff;
    --rm-surface-elevated: #fdfdff;
    --rm-border: #dbe5f4;
    --rm-border-soft: #e9eef8;
    --rm-text: #0f172a;
    --rm-text-soft: #475569;
    --rm-muted: #94a3b8;
    --rm-primary: #1f6feb;
    --rm-primary-strong: #1d4ed8;
    --rm-primary-soft: #eaf2ff;
    --rm-success: #0f9f6e;
    --rm-success-soft: #ecfdf3;
    --rm-danger: #d92d20;
    --rm-danger-soft: #fef2f2;
    --rm-warning: #d97706;
    --rm-warning-soft: #fff7ed;
    --rm-info: #2563eb;
    --rm-shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
    --rm-shadow-card: 0 16px 38px rgba(15, 23, 42, 0.1);
    --rm-radius: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--rm-font-sans);
    color: var(--rm-text);
}

body.rm-body {
    background:
        radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0) 32%),
        radial-gradient(circle at 0% 100%, rgba(56, 189, 248, 0.16) 0%, rgba(56, 189, 248, 0) 35%),
        linear-gradient(180deg, var(--rm-bg) 0%, var(--rm-bg-soft) 45%, #f7fafc 100%);
    background-attachment: fixed;
}

a {
    color: var(--rm-primary);
    text-decoration: none;
}

a:hover {
    color: var(--rm-primary-strong);
}

/* App shell */
.rm-shell {
    display: flex;
    min-height: 100vh;
}

.rm-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 264px;
    padding: 1rem 0.85rem 0.9rem;
    background: linear-gradient(170deg, #0f172a 0%, #111827 46%, #0b1222 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 20px 0 45px rgba(2, 6, 23, 0.28);
    display: flex;
    flex-direction: column;
    z-index: 60;
    overflow-y: auto;
    transition: width 0.24s ease, padding 0.24s ease, transform 0.24s ease;
}

.rm-sidebar::-webkit-scrollbar {
    width: 8px;
}

.rm-sidebar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 9999px;
}

.rm-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 55;
}

.rm-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
    padding: 0.62rem;
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.55);
    border: none;
    color: #e2e8f0;
    justify-content: center;
    transition: padding 0.2s ease, border-radius 0.2s ease, background 0.2s ease;
}

.rm-brand:hover {
    color: #f8fafc;
}

.rm-brand-logo {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 0.8rem;
    border: none;
    transition: max-width 0.2s ease;
}

.rm-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.rm-brand-text strong {
    font-size: 0.94rem;
    letter-spacing: 0.01em;
}

.rm-brand-text small {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}

.rm-nav {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
}

.rm-nav-link,
.rm-nav-group > summary,
.rm-nav-sublink {
    border-radius: 0.75rem;
    transition: all 0.18s ease;
}

.rm-nav-link,
.rm-nav-group > summary {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 38px;
    padding: 0.5rem 0.64rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #cbd5e1;
    cursor: pointer;
    white-space: nowrap;
}

.rm-nav-link i,
.rm-nav-group > summary i {
    width: 1rem;
    text-align: center;
    color: #7dd3fc;
}

.rm-nav-link:hover,
.rm-nav-group > summary:hover {
    color: #f8fafc;
    background: rgba(59, 130, 246, 0.2);
}

.rm-nav-link.is-active,
.rm-nav-group > summary.is-active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.42) 0%, rgba(37, 99, 235, 0.12) 100%);
    border: 1px solid rgba(125, 211, 252, 0.35);
}

.rm-nav-group {
    margin: 0;
}

.rm-nav-group > summary {
    list-style: none;
    position: relative;
}

.rm-nav-group > summary::-webkit-details-marker {
    display: none;
}

.rm-nav-group > summary::after {
    content: "";
    margin-left: auto;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(45deg);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.rm-nav-group[open] > summary::after {
    transform: rotate(-135deg);
}

.rm-nav-group[open] > summary {
    color: #f8fafc;
    background: rgba(37, 99, 235, 0.16);
}

.rm-nav-sublink {
    display: block;
    margin-left: 1.85rem;
    margin-top: 0.22rem;
    padding: 0.44rem 0.62rem;
    font-size: 0.83rem;
    font-weight: 400;
    color: #94a3b8;
}

.rm-nav-sublink:hover {
    color: #e2e8f0;
    justify-content: center;
    background: rgba(148, 163, 184, 0.15);
}

.rm-nav-sublink.is-active {
    color: #dbeafe;
    background: rgba(37, 99, 235, 0.28);
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.3);
}

.rm-sidebar-logout {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 38px;
    padding: 0.55rem 0.64rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(248, 113, 113, 0.32);
    color: #fecaca;
    background: rgba(239, 68, 68, 0.15);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.rm-sidebar-logout:hover {
    color: #fee2e2;
    background: rgba(239, 68, 68, 0.25);
}

.rm-stage {
    flex: 1;
    margin-left: 264px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left 0.24s ease;
}

.rm-topbar {
    position: sticky;
    top: 0;
    z-index: 35;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.4rem;
    background: rgba(248, 250, 252, 0.82);
    border-bottom: 1px solid var(--rm-border-soft);
    backdrop-filter: blur(10px);
}

.rm-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 0.75rem;
    border: 1px solid var(--rm-border);
    background: #ffffff;
    color: var(--rm-text);
    cursor: pointer;
    box-shadow: var(--rm-shadow-soft);
    transition: all 0.18s ease;
}

.rm-sidebar-toggle:hover {
    border-color: #bfd2ef;
    background: #f8fbff;
}

@media (min-width: 992px) {
    body.rm-sidebar-collapsed .rm-sidebar {
        width: 82px;
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }

    body.rm-sidebar-collapsed .rm-stage {
        margin-left: 82px;
    }

    body.rm-sidebar-collapsed .rm-brand {
        padding: 0.55rem;
        border-radius: 0.9rem;
    }

    body.rm-sidebar-collapsed .rm-brand-logo {
        max-width: 48px;
    }

    body.rm-sidebar-collapsed .rm-nav-link,
    body.rm-sidebar-collapsed .rm-nav-group > summary,
    body.rm-sidebar-collapsed .rm-sidebar-logout {
        justify-content: center;
        gap: 0;
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }

    body.rm-sidebar-collapsed .rm-nav-link span,
    body.rm-sidebar-collapsed .rm-nav-group > summary span,
    body.rm-sidebar-collapsed .rm-sidebar-logout span,
    body.rm-sidebar-collapsed .rm-nav-group > summary::after,
    body.rm-sidebar-collapsed .rm-nav-sublink {
        display: none;
    }

    body.rm-sidebar-collapsed .rm-nav-link i,
    body.rm-sidebar-collapsed .rm-nav-group > summary i,
    body.rm-sidebar-collapsed .rm-sidebar-logout i {
        width: 1rem;
        min-width: 1rem;
        margin: 0;
        font-size: 1rem;
        text-align: center;
    }

    body.rm-sidebar-collapsed .rm-nav-group[open] > summary {
        background: linear-gradient(90deg, rgba(37, 99, 235, 0.42) 0%, rgba(37, 99, 235, 0.12) 100%);
        border: 1px solid rgba(125, 211, 252, 0.35);
    }

    .rm-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 991.98px) {
    .rm-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

.rm-topbar-title {
    min-width: 0;
}

.rm-topbar-title h1 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: #0b1324;
    letter-spacing: 0.01em;
}

.rm-topbar-title p {
    margin: 0.2rem 0 0;
    color: var(--rm-text-soft);
    font-size: 0.86rem;
}

.rm-topbar-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 0.95rem;
    background: #ffffff;
    border: 1px solid var(--rm-border);
    box-shadow: var(--rm-shadow-soft);
}

.rm-topbar-logo img {
    max-width: 38px;
    max-height: 38px;
    object-fit: contain;
}

.rm-main {
    flex: 1;
    padding: 1.2rem 1.4rem 1.35rem;
}

.rm-main-container {
    max-width: 1540px;
}

.page-content-inner {
    display: flex;
    flex-direction: column;
    gap: 1.05rem;
}

.rm-inline-alert {
    margin-bottom: 0.4rem;
}

.rm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.4rem 1.2rem;
    color: #64748b;
    font-size: 0.8rem;
}

/* Generic layout helpers */
.container-fluid {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.55rem;
    margin-left: -0.55rem;
}

[class^="col-"],
[class*=" col-"] {
    position: relative;
    width: 100%;
    min-height: 1px;
    padding-right: 0.55rem;
    padding-left: 0.55rem;
    margin-bottom: 0.7rem;
}

@media (min-width: 992px) {
    .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (max-width: 991.98px) {
    .rm-sidebar {
        transform: translateX(-100%);
        transition: transform 0.24s ease;
    }

    .rm-stage {
        margin-left: 0;
    }

    body.rm-sidebar-open .rm-sidebar {
        transform: translateX(0);
    }

    body.rm-sidebar-open .rm-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .rm-topbar-title h1 {
        font-size: 1.05rem;
    }

    .rm-topbar-title p {
        display: none;
    }

    .rm-main {
        padding: 1rem;
    }

    .rm-footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.8rem 1rem 1.1rem;
    }
}

/* Utility classes used by existing views */
.pull-left { float: left !important; }
.pull-right { float: right !important; }
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-danger { color: var(--rm-danger) !important; }
.text-success { color: var(--rm-success) !important; }
.text-info { color: var(--rm-info) !important; }
.bold { font-weight: 700 !important; }
.uppercase { text-transform: uppercase !important; }
.d-flex { display: flex !important; }
.flex { display: flex !important; }
.flex-column { flex-direction: column !important; }
.w-100 { width: 100% !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.2rem !important; }
.mb-5 { margin-bottom: 1.55rem !important; }
.px-5 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
.py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.my-8 { margin-top: 2rem !important; margin-bottom: 2rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-4 { gap: 1rem !important; }
.items-start { align-items: flex-start !important; }
.justify-end { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.w-full { width: 100% !important; }
.max-w-3xl { max-width: 48rem !important; }
.max-w-5xl { max-width: 64rem !important; }
.border { border: 1px solid var(--rm-border) !important; }
.border-b { border-bottom: 1px solid var(--rm-border-soft) !important; }
.border-t { border-top: 1px solid var(--rm-border-soft) !important; }
.border-slate-200 { border-color: var(--rm-border-soft) !important; }
.rounded-md { border-radius: 0.6rem !important; }
.rounded-2xl { border-radius: 1rem !important; }
.overflow-hidden { overflow: hidden !important; }
.bg-white { background: #fff !important; }
.text-slate-500 { color: #64748b !important; }
.hover\:bg-slate-100:hover { background: #f1f5f9 !important; }
.hover\:text-slate-700:hover { color: #334155 !important; }
.shadow-2xl { box-shadow: var(--rm-shadow-card) !important; }
.transition { transition: all 0.18s ease !important; }

/* Cards / Portlets */
.portlet,
.kt-portlet {
    background: linear-gradient(180deg, var(--rm-surface) 0%, var(--rm-surface-elevated) 100%);
    border: 1px solid var(--rm-border);
    border-radius: var(--rm-radius);
    box-shadow: var(--rm-shadow-soft);
}

.portlet.light,
.kt-portlet.m-portlet--first,
.kt-portlet.m-portlet--bordered-semi {
    border-color: var(--rm-border);
}

.portlet > .portlet-title,
.kt-portlet__head {
    border-bottom: 1px solid var(--rm-border-soft);
    padding: 1rem 1.15rem;
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.portlet > .portlet-body,
.m-portlet__body,
.kt-portlet__body,
.portlet-body {
    padding: 1rem 1.15rem;
}

.kt-portlet__head-title,
.caption-subject,
.caption {
    margin: 0;
    color: #0b1324;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.kt-portlet__head-label,
.caption {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.kt-form__help,
small {
    color: var(--rm-text-soft);
    font-size: 0.78rem;
}

.m-portlet__foot,
.kt-portlet__foot,
.m-form__actions,
.kt-form__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.55rem;
    padding: 0.8rem 0 0;
}

/* Forms */
label {
    display: inline-block;
    margin-bottom: 0.42rem;
    color: #1e293b;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

.form-group,
.form-md-line-input,
.form-md-floating-label {
    margin-bottom: 0.88rem;
}

.form-control,
select.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"] {
    display: block;
    width: 100%;
    min-height: 42px;
    border: 1px solid #cfd9ea;
    border-radius: 0.72rem;
    background: #ffffff;
    color: #0f172a;
    padding: 0.5rem 0.72rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.form-control-sm {
    min-height: 38px;
    padding: 0.4rem 0.62rem;
    border-radius: 0.64rem;
}

textarea.form-control {
    min-height: 110px;
    resize: vertical;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 0;
    border-color: #8ab4ff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
    background: #ffffff;
}

input[readonly],
input[disabled],
select[disabled],
textarea[disabled] {
    background: #f3f6fb;
    color: #64748b;
}

.form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.25rem;
}

.form-check-input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.help-block,
.invalid-feedback,
.field-validation-error,
.validation-summary-errors li {
    display: block;
    margin-top: 0.32rem;
    font-size: 0.76rem;
    color: var(--rm-danger);
}

.input-group {
    display: flex;
    width: 100%;
}

.input-group > .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    margin-bottom: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 38px;
    padding: 0.48rem 0.9rem;
    border-radius: 0.68rem;
    border: 1px solid transparent;
    font-size: 0.83rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.13);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-check-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.btn-default {
    background: #ffffff;
    border-color: #cfd9ea;
    color: #334155;
}

.btn-primary {
    color: #ffffff;
    border-color: var(--rm-primary);
    background: linear-gradient(135deg, #2f7cf5 0%, #1d4ed8 100%);
}

.btn-success {
    color: #ffffff;
    border-color: #10a677;
    background: linear-gradient(135deg, #19b884 0%, #0e8f67 100%);
}

.btn-danger,
.red {
    color: #ffffff;
    border-color: #d92d20;
    background: linear-gradient(135deg, #ef4444 0%, #d92d20 100%);
}

.btn-info {
    color: #ffffff;
    border-color: #2563eb;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-circle { border-radius: 999px !important; }
.btn-sm { min-height: 32px; font-size: 0.75rem; padding: 0.35rem 0.6rem; }
.btn-xs { min-height: 26px; font-size: 0.69rem; padding: 0.24rem 0.45rem; }
.btn-action { min-width: 38px; }

.btn-group {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    gap: 0.2rem;
}

.btn-group > .btn {
    position: relative;
}

/* Dropdowns */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    z-index: 1200;
    min-width: 215px;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    border-radius: 0.8rem;
    border: 1px solid #d7e2f1;
    background: #ffffff;
    box-shadow: 0 20px 35px rgba(15, 23, 42, 0.18);
    display: none;
}

.open > .dropdown-menu,
.btn-group.open > .dropdown-menu,
.dropdown.open > .dropdown-menu,
.navbar-nav > li.open > .dropdown-menu,
.navbar-nav > li:hover > .dropdown-menu {
    display: block;
}

.dropdown-menu > li > a,
.nav-link {
    display: block;
    border-radius: 0.62rem;
    padding: 0.48rem 0.62rem;
    color: #1e293b;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.dropdown-menu > li > a:hover,
.nav-link:hover {
    color: #1d4ed8;
    background: #eff6ff;
}

.dropdown-menu .divider {
    border-top: 1px solid #e2e8f0;
    margin: 0.35rem 0;
}

.navbar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.45rem;
}

.navbar-nav > li {
    position: relative;
}

.arrow {
    margin-left: 0.3rem;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border: 1px solid var(--rm-border);
    border-radius: 0.85rem;
    overflow: hidden;
}

.table > thead > tr > th {
    background: #f1f5ff;
    color: #0f172a;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    font-weight: 800;
    border-bottom: 1px solid var(--rm-border);
    border-right: 1px solid var(--rm-border-soft);
    padding: 0.66rem 0.64rem;
    vertical-align: middle;
}

.table > thead > tr > th:last-child {
    border-right: none;
}

.table > tbody > tr > td {
    padding: 0.62rem 0.64rem;
    border-bottom: 1px solid var(--rm-border-soft);
    border-right: 1px solid var(--rm-border-soft);
    color: #1e293b;
    font-size: 0.79rem;
    vertical-align: middle;
}

.table > tbody > tr > td:last-child {
    border-right: none;
}

.table > tbody > tr:last-child > td {
    border-bottom: none;
}

.table-striped > tbody > tr:nth-child(odd) {
    background: #f9fbff;
}

.table-hover > tbody > tr:hover {
    background: #eef4ff;
}

.table-condensed > thead > tr > th,
.table-condensed > tbody > tr > td {
    padding: 0.46rem 0.5rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

/* Datatables */
.dataTables_wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.dataTables_wrapper .row {
    margin-left: -0.35rem;
    margin-right: -0.35rem;
    align-items: center;
}
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #cfd9ea;
    border-radius: 0.6rem;
    min-height: 34px;
    min-width: 78px;
    padding: 0.28rem 0.55rem;
}

.dataTables_wrapper .dataTables_info {
    color: #64748b;
    font-size: 0.78rem;
    padding-top: 0.45rem;
}

.dataTables_wrapper .dataTables_paginate {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
    align-items: center;
}

.dataTables_wrapper .paginate_button {
    min-width: 32px;
    height: 32px;
    padding: 0.35rem 0.58rem !important;
    border-radius: 0.55rem;
    border: 1px solid #d5deec !important;
    background: #ffffff !important;
    color: #334155 !important;
    font-size: 0.74rem;
    font-weight: 700;
}

.dataTables_wrapper .paginate_button.current,
.dataTables_wrapper .paginate_button:hover {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #1d4ed8 !important;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.2rem 0.58rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.015em;
    border: 1px solid transparent;
}

.badge-inline { white-space: nowrap; }
.badge-lg { font-size: 0.7rem; padding: 0.24rem 0.62rem; }
.badge-success { background: var(--rm-success-soft); color: var(--rm-success); border-color: #a7f3d0; }
.badge-danger { background: var(--rm-danger-soft); color: var(--rm-danger); border-color: #fecaca; }
.badge-warning { background: var(--rm-warning-soft); color: var(--rm-warning); border-color: #fed7aa; }
.badge-info { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }

/* Alerts and notes */
.alert,
.note {
    position: relative;
    border-radius: 0.8rem;
    padding: 0.75rem 0.92rem;
    border: 1px solid transparent;
    font-size: 0.82rem;
}

.alert-danger,
.note.note-danger {
    background: var(--rm-danger-soft);
    color: #991b1b;
    border-color: #fecaca;
}

.alert-success,
.note.note-success {
    background: var(--rm-success-soft);
    color: #047857;
    border-color: #a7f3d0;
}

.alert-info,
.note.note-info {
    background: #eef6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: none;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.54);
}

.modal.fade {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal.in,
.modal.show {
    display: block;
    opacity: 1;
}

.modal-dialog {
    width: auto;
    max-width: 720px;
    margin: 1.5rem auto;
}

.modal-lg {
    max-width: 980px;
}

.modal-content {
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid var(--rm-border);
    box-shadow: 0 24px 55px rgba(2, 6, 23, 0.28);
}

.modal-header,
.modal-body,
.modal-footer {
    padding: 1rem 1.2rem;
}

.modal-header {
    border-bottom: 1px solid var(--rm-border-soft);
}

.modal-footer {
    border-top: 1px solid var(--rm-border-soft);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.modal-title {
    margin: 0;
    font-weight: 800;
    color: #0b1324;
}

.close {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.close:empty::before {
    content: "\00D7";
}

.hide {
    display: none !important;
}

.fade {
    transition: opacity 0.2s ease;
}

body.modal-open {
    overflow: hidden;
}

/* Dashboard ribbons */
.mt-element-ribbon {
    position: relative;
    padding: 0.85rem;
    border: 1px solid var(--rm-border);
    border-radius: 0.75rem;
    background: #ffffff;
}

.bg-grey-cararra {
    background: #ffffff;
}

.ribbon {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

.ribbon-shadow {
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

.ribbon-color-danger {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.ribbon-content {
    margin: 0;
}

.font-dark {
    color: #0f172a;
}

/* Authentication */
body.login {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 22%, rgba(37, 99, 235, 0.35) 0%, rgba(37, 99, 235, 0) 32%),
        radial-gradient(circle at 82% 12%, rgba(45, 212, 191, 0.24) 0%, rgba(45, 212, 191, 0) 28%),
        linear-gradient(150deg, #0b1222 0%, #0f172a 52%, #111827 100%);
    display: grid;
    place-items: center;
    padding: 1.2rem;
}

.rm-auth-shell {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) minmax(300px, 1fr);
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 1.3rem;
    overflow: hidden;
    background: rgba(10, 17, 32, 0.58);
    box-shadow: 0 35px 65px rgba(2, 6, 23, 0.45);
    backdrop-filter: blur(9px);
}

.rm-auth-panel {
    padding: 2rem 1.9rem;
    background: linear-gradient(160deg, rgba(37, 99, 235, 0.45) 0%, rgba(37, 99, 235, 0.1) 100%);
    color: #dbeafe;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

.rm-auth-panel h2 {
    margin: 0;
    font-size: 1.55rem;
    color: #ffffff;
    font-weight: 800;
}

.rm-auth-panel p {
    margin: 0.55rem 0 0;
    color: #dbeafe;
    line-height: 1.45;
    font-size: 0.9rem;
}

.rm-auth-highlights {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.45rem;
}

.rm-auth-highlights li {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    font-size: 0.82rem;
    color: #bfdbfe;
}

.rm-auth-form-wrap {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem 1.9rem;
}

.login-container {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.88rem;
}

.rm-login-brand {
    display: flex;
    justify-content: center;
    text-align: center;
    margin-bottom: 0.25rem;
}

.rm-login-brand img {
    display: block;
    max-width: 180px;
    margin: 0 auto;
}

.rm-login-title {
    margin: 0;
    font-size: 1.35rem;
    color: #0f172a;
    font-weight: 800;
    text-align: center;
}

.rm-login-subtitle {
    margin: 0.3rem 0 0;
    color: #475569;
    font-size: 0.84rem;
    text-align: center;
}

.rm-login-submit {
    width: 100%;
    min-height: 42px;
    font-size: 0.88rem;
}

@media (max-width: 880px) {
    .rm-auth-shell {
        grid-template-columns: 1fr;
    }

    .rm-auth-panel {
        padding: 1.45rem 1.25rem;
    }

    .rm-auth-form-wrap {
        padding: 1.45rem 1.25rem;
    }
}

/* Second-pass refinements: dashboard, reports, mobile table ergonomics */
.rm-dashboard-grid,
.rm-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.85rem;
}

.rm-dashboard-grid {
    margin-bottom: 0.25rem;
}

.rm-dashboard-grid > .rm-kpi-card:only-child {
    width: 100%;
    max-width: calc((100% - 1.7rem) / 3);
    justify-self: start;
}

@media (max-width: 991px) {
    .rm-dashboard-grid > .rm-kpi-card:only-child {
        max-width: none;
    }
}

.rm-kpi-card {
    background: linear-gradient(160deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--rm-border);
    border-radius: 0.9rem;
    padding: 0.85rem 0.95rem;
    box-shadow: var(--rm-shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}

.rm-kpi-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    color: #64748b;
    font-weight: 800;
}

.rm-kpi-value {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.05;
}

.rm-kpi-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    color: #64748b;
    font-size: 0.76rem;
}

.rm-kpi-card-danger {
    border-color: #fecaca;
    background: linear-gradient(160deg, #fff8f8 0%, #fff5f5 100%);
}

.rm-kpi-card-danger .rm-kpi-value,
.rm-kpi-card-danger .rm-kpi-title {
    color: #b91c1c;
}

.rm-kpi-card-warning {
    border-color: #fed7aa;
    background: linear-gradient(160deg, #fffbf3 0%, #fff7ed 100%);
}

.rm-kpi-card-warning .rm-kpi-value,
.rm-kpi-card-warning .rm-kpi-title {
    color: #b45309;
}

.rm-kpi-card-info {
    border-color: #bfdbfe;
    background: linear-gradient(160deg, #f7faff 0%, #eff6ff 100%);
}

.rm-kpi-card-info .rm-kpi-value,
.rm-kpi-card-info .rm-kpi-title {
    color: #1d4ed8;
}

.rm-dashboard-actions .portlet-body {
    padding-top: 0.55rem;
    padding-bottom: 0.35rem;
}

.rm-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.55rem;
}

.rm-action-card {
    min-height: 62px;
    border: 1px solid var(--rm-border-soft);
    border-radius: 0.72rem;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.26rem;
    padding: 0.55rem 0.65rem;
    color: #1e293b;
    font-weight: 700;
    font-size: 0.86rem;
    line-height: 1.2;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.rm-action-card i {
    color: #2563eb;
    font-size: 0.95rem;
}

.rm-action-card:hover {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.rm-report-section .portlet-body {
    padding-top: 0.95rem;
}

.rm-report-note {
    margin-top: 0;
    margin-bottom: 0.7rem;
    color: #64748b;
    font-size: 0.8rem;
}

.rm-report-toolbar > [class*="col-"] {
    margin-bottom: 0.1rem;
}

.rm-toolbar-submit {
    display: flex;
    align-items: flex-end;
}

.rm-export-group {
    margin-bottom: 0;
}

.rm-export-label {
    display: inline-block;
    margin-bottom: 0.35rem;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rm-report-summary .portlet-body {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.rm-summary-total {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 0.5rem;
}

.rm-summary-total p {
    margin: 0;
    color: #64748b;
    font-size: 0.82rem;
}

.rm-summary-total strong {
    font-size: 1.15rem;
    color: #0f172a;
}

.rm-chart-surface {
    width: 100%;
    min-height: 380px;
}

/* Mobile readable table cards */
@media (max-width: 767.98px) {
    .table.rm-mobile-ready {
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .table.rm-mobile-ready thead {
        display: none;
    }

    .table.rm-mobile-ready tbody tr {
        display: block;
        border: 1px solid var(--rm-border);
        border-radius: 0.8rem;
        background: #ffffff;
        margin-bottom: 0.65rem;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
        overflow: hidden;
    }

    .table.rm-mobile-ready tbody tr:last-child {
        margin-bottom: 0;
    }

    .table.rm-mobile-ready tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.65rem;
        border: 0;
        border-bottom: 1px solid var(--rm-border-soft);
        padding: 0.52rem 0.72rem;
        text-align: right !important;
        font-size: 0.77rem;
    }

    .table.rm-mobile-ready tbody td::before {
        content: attr(data-label);
        color: #475569;
        font-size: 0.67rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        font-weight: 800;
        text-align: left;
        flex: 0 0 45%;
    }

    .table.rm-mobile-ready tbody td:last-child {
        border-bottom: 0;
    }

    .table.rm-mobile-ready tbody td.rm-table-actions-cell {
        display: block;
        text-align: left !important;
        padding-top: 0.62rem;
    }

    .table.rm-mobile-ready tbody td.rm-table-actions-cell::before {
        display: block;
        margin-bottom: 0.42rem;
    }

    .table.rm-mobile-ready tbody td.rm-table-actions-cell .btn,
    .table.rm-mobile-ready tbody td.rm-table-actions-cell .btn-group {
        margin-right: 0.35rem;
        margin-bottom: 0.35rem;
    }

    .rm-kpi-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .rm-chart-surface {
        min-height: 300px;
    }
}







