:root {
    --bg: #0f172a;
    --panel: #111827;
    --panel-2: #0b1224;
    --surface: #ffffff;
    --border: #e5e7eb;
    --muted: #6b7280;
    --text: #111827;
    --primary: #2563eb;
    --primary-strong: #1d4ed8;
    --primary-soft: #e0e7ff;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    --radius: 14px;
    --nav-width: 280px;
    --nav-gap: 12px;
}

html, body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: #ffffff;
    color: #222c64;
    margin: 0;
}

a {
    color: #337ab7;
}

a:hover,
a:focus {
    color: #23527c;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--nav-width) 1fr;
    min-height: 100vh;
    background: #f4f6fb;
}

/* Top navbar style - legacy look: dark blue, green borders, cyan text */
.rm-navbar {
    background: #003366 !important;
    border-top: 2px solid #51B948;
    border-bottom: 2px solid #51B948;
    box-shadow: none;
    min-height: 44px;
    border-radius: 0;
}

.rm-navbar .navbar-brand,
.rm-navbar .nav-link,
.rm-navbar .navbar-toggler,
.rm-navbar .navbar-toggler-icon,
.rm-navbar .rm-user,
.rm-navbar .rm-user-email {
    color: #7dd3fc !important;
}

.rm-navbar .nav-link.active,
.rm-navbar .nav-link:hover {
    color: #bae6fd !important;
}

.rm-navbar .rm-logout {
    color: #93c5fd !important;
    font-size: 12px;
    text-decoration: none;
    display: block;
    margin-top: 2px;
}

.rm-navbar .rm-logout:hover {
    color: #fff !important;
}

.rm-navbar .rm-user-block {
    text-align: right;
    padding: 4px 0;
}

.rm-navbar .dropdown-menu {
    border-radius: 0;
    border: 1px solid #cccccc;
    box-shadow: none;
}

.rm-navbar .dropdown-item {
    font-weight: 400;
}

.rm-navbar .dropdown-item:active {
    background: var(--primary);
}

.rm-navbar-brand {
    padding: 2px 12px 2px 0;
    margin-right: 6px;
    height: 42px;
    display: flex;
    align-items: center;
}

.rm-logo {
    width: auto !important;
    max-width: none !important;
    height: 48px !important;
    display: block;
}

.rm-brand-text {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.rm-user {
    color: rgba(255,255,255,0.92);
    font-weight: 700;
    font-size: 14px;
}

.rm-navbar .nav-link {
    font-size: 12px;
    padding: 11px 8px !important;
    font-weight: 600;
}

.rm-navbar .nav-link i.bi {
    opacity: 0.95;
}

@media (max-width: 991.98px) {
    .rm-logo {
        height: 38px !important;
    }
}

.rm-layout-wrapper {
    display: flex;
    flex-wrap: nowrap;
    min-height: calc(100vh - 56px);
}

.rm-sidebar {
    flex: 0 0 240px;
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    color: #fff;
    padding: 16px 0;
    box-shadow: 4px 0 18px rgba(0,0,0,0.12);
    overflow-y: auto;
}

.rm-sidebar .menu {
    padding: 0 12px;
}

.rm-footer {
    margin-top: 1rem;
}

.rm-content {
    background: #f5f5f5;
    min-height: calc(100vh - 47px);
    flex: 1;
}

@media (max-width: 991.98px) {
    .rm-layout-wrapper {
        flex-direction: column;
    }
    .rm-sidebar {
        flex: 0 0 auto;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
}

.app-sidebar {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    color: #fff;
    padding: 20px;
    box-shadow: 4px 0 18px rgba(0,0,0,0.22);
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    margin-bottom: 18px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-text {
    line-height: 1.1;
}

.brand-title {
    font-weight: 700;
}

.brand-subtitle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.menu-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.55);
    padding: 0 8px;
}

.menu-link {
    display: grid;
    grid-template-columns: 26px 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #e5e7eb;
    text-decoration: none;
    transition: all 0.15s ease;
}

.menu-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.menu-link.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.menu-icon {
    font-size: 1rem;
}

.app-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f8fafc;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.topbar-subtitle {
    font-size: 0.9rem;
    color: var(--muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-content {
    padding: 26px 32px 40px;
}

.content-surface {
    background: #ffffff;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    padding: 18px;
    background: #fff;
}

.table {
    border-collapse: collapse;
}

.table th, .table td {
    vertical-align: middle;
}

.table thead th {
    background: #f3f4f6;
    border-bottom: 1px solid var(--border);
}

button, .btn {
    border-radius: 4px;
    font-weight: 400;
    padding: 6px 12px;
    border: 1px solid transparent;
    transition: none;
}

.btn-primary, button[type=submit].btn-primary {
    background: #337ab7;
    border-color: #2e6da4;
    color: #fff;
    box-shadow: none;
}

.btn-primary:hover {
    background: #286090;
    border-color: #204d74;
}

.btn-default {
    background: #ffffff;
    border: 1px solid #cccccc !important;
    color: #333333 !important;
    box-shadow: none !important;
}

.btn-default:hover {
    background: #e6e6e6;
    border-color: #adadad !important;
    color: #333333 !important;
}

.btn-info {
    background: #5bc0de;
    border-color: #46b8da;
    color: #ffffff;
}

.btn-info:hover,
.btn-info:focus {
    background: #31b0d5;
    border-color: #269abc;
    color: #ffffff;
}

.form-control, .form-select {
    border-radius: 0;
    border: 1px solid #ccc;
    padding: 6px 12px;
    background: #ffffff;
    color: #555555;
}

.alert {
    border-radius: 4px;
    box-shadow: none;
}

/* Login layout */
.login-shell {
    min-height: calc(100vh - 53px);
    display: block;
    background: #ffffff;
    padding: 22px 0 30px;
}

.login-surface {
    width: min(1140px, 100%);
    margin: 0 auto;
    padding: 0 15px;
}

.login-hero {
    display: flex;
    justify-content: center;
}

.login-card {
    background: #fff;
    border-radius: 18px;
    padding: 28px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14);
}

.login-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.login-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--primary);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 12px 24px rgba(37,99,235,0.35);
}

.login-title {
    font-weight: 800;
    font-size: 1.2rem;
}

.login-subtitle {
    color: var(--muted);
}

.login-body {
    margin: 14px 0 10px;
}

.login-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.login-btn {
    width: 100%;
    justify-content: center;
}

.btn.btn-secondary {
    background: #0f172a;
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.btn.btn-ghost {
    background: #f1f5f9;
    color: var(--text);
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

.btn.btn-ghost:hover {
    background: #e2e8f0;
}

.login-footer {
    margin-top: 16px;
    font-size: 0.92rem;
    color: var(--muted);
}

/* Auth page styling */
.auth-page {
    margin-top: 0;
}

.login-surface .auth-page {
    justify-content: center;
}

.auth-section {
    background: #ffffff;
    border: none;
    box-shadow: none;
    border-radius: 0;
    color: #222c64;
    padding: 0;
}

.auth-section .form-control {
    border-radius: 0;
    min-height: 34px;
    max-width: 280px;
}

.auth-section .btn {
    border-radius: 4px;
    padding: 6px 12px;
    font-weight: 400;
}

.auth-section hr {
    border-top: 1px solid #e5e5e5;
}

.auth-section h2 {
    font-size: 30px;
    margin-bottom: 10px;
}

.auth-section h3 {
    font-size: 24px;
}

.auth-section h4 {
    font-size: 18px;
}

.auth-section .row {
    margin-left: 0;
    margin-right: 0;
}

.auth-section .col-form-label {
    font-weight: 400;
    padding-top: 7px;
    color: #222c64;
}

.bgGreen {
    background: transparent;
}

/* Register page modernization with established palette */
.register-modern-page .auth-section {
    max-width: 1140px;
}

.register-intro {
    border: 1px solid #bcdff1;
    background: #f0f8fc;
    color: #23527c;
}

.register-grid .form-control {
    max-width: none;
    min-height: 32px;
    padding: 5px 10px;
}

.register-card {
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
}

.register-card-title {
    margin-top: 0;
    margin-bottom: 0.65rem;
    font-size: 17px;
    color: #222c64;
}

.register-side-card {
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
}

.register-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.register-modern-page .form-label {
    margin-bottom: 0.2rem;
}

/* Shared page container parity with prior body-content spacing */
.body-content {
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 15px;
    padding-bottom: 8px;
}

.rm-page-heading {
    font-size: 36px;
    font-weight: 400;
    margin: 8px 0 14px 0;
    color: #222c64;
}

.bulk-upload-notices-label {
    display: block;
    text-align: left !important;
}

.rm-filter-compact {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 14px;
}

.rm-filter-compact .form-control,
.rm-filter-compact .form-select {
    height: 28px;
    min-height: 28px;
    padding: 4px 8px;
    font-size: 12px;
}

.rm-tab-btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 3px;
}

.rm-highlight-panel {
    background: #fff;
    border: 1px solid #c9d6e3;
    border-radius: 3px;
    margin-bottom: 12px;
}

.rm-highlight-panel-title {
    padding: 10px 14px;
    font-size: 18px;
    border-bottom: 1px solid #d9d9d9;
}

.rm-highlight-panel-title--blue {
    background: #337ab7;
    color: #fff;
}

.rm-highlight-panel-title--green {
    background: #dff0d8;
    color: #3c763d;
}

.rm-highlight-panel-title--red {
    background: #f2dede;
    color: #a94442;
}

.rm-highlight-panel-title--info {
    background: #d9edf7;
    color: #31708f;
}

.rm-highlight-panel-title--tan {
    background: #fcf8e3;
    color: #8a6d3b;
}

.rm-highlight-panel-body {
    padding: 10px 14px;
    font-size: 12px;
}

.rm-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
}

.rm-compact-table {
    font-size: 11px;
}

.rm-compact-table th,
.rm-compact-table td {
    padding: 4px 6px !important;
    white-space: nowrap;
}

/* Reusable grid/table primitives for full-site parity + UX */
.rm-table-wrapper--with-pager {
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.rm-order-grid-container {
    margin-bottom: 1rem;
}

.rm-order-grid-container .rm-compact-table th,
.rm-order-grid-container .rm-compact-table td {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
}

.rm-order-grid-container .rm-table-wrapper {
    overflow-x: auto;
}

.rm-order-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-top: none;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    background: #fff;
    color: #337ab7;
    font-size: 0.95rem;
}

.rm-order-pager-detail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.rm-order-pager-size {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.rm-order-page-size {
    width: auto;
    min-width: 4.5rem;
}

.rm-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    margin-bottom: 1rem;
}

.rm-table-wrapper--sticky .table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f5f5f5;
    box-shadow: inset 0 -1px 0 #ddd;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    margin-bottom: 1rem;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    font-weight: 600;
    color: #222c64;
}

.table tbody tr:hover {
    background-color: #f9f9f9;
}

.table td,
.table th {
    vertical-align: middle;
}

.rm-data-table th,
.rm-data-table td {
    padding: 0.5rem 0.75rem;
}

/* Keep grid action buttons fully visible (DxGrid cell content uses overflow:hidden) */
.rm-grid-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.rm-data-table td:has(.rm-grid-actions),
.rm-data-table th:has(.rm-grid-actions),
.rm-data-table td:has(.rm-grid-actions) > *,
.rm-data-table .dxbl-grid-table td:has(.rm-grid-actions),
.rm-data-table .dxbl-grid-table td:has(.rm-grid-actions) > div {
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
}

.rm-data-table .rm-grid-actions .btn {
    flex-shrink: 0;
}

.rm-image-preview {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
    background: #fff;
}

.rm-image-preview__button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.rm-image-preview img {
    max-height: 50px;
    max-width: 120px;
    width: auto;
    display: block;
}

.rm-image-preview__placeholder {
    font-size: 12px;
    color: #666;
    max-width: 140px;
    text-align: center;
}

.rm-filter-panel {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.admin-users-page {
    max-width: 100%;
}

.admin-users-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.admin-users-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.admin-users-stat-card {
    background: #fff;
    border: 1px solid #d8dce7;
    border-radius: 4px;
    padding: 0.7rem 0.85rem;
}

.admin-users-stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    margin-bottom: 0.2rem;
}

.admin-users-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1f2e63;
    line-height: 1.1;
}

.admin-users-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.admin-users-wrap {
    white-space: normal;
    word-break: break-word;
}

.rm-form-panel,
.rm-detail-panel {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.rm-detail-dl dt,
.rm-detail-dl dd {
    line-height: 1.42857143;
    margin-bottom: 6px;
}

.rm-detail-dl dt {
    color: #222c64;
    font-weight: 600;
}

.rm-detail-dl dd {
    color: #333;
}

.rm-form-panel .form-group {
    margin-bottom: 10px;
}

/* Inline form layout (legacy label/field side-by-side) */
.rm-inline-form .form-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.rm-inline-form {
    max-width: 640px;
    margin: 0 auto;
}

.rm-inline-form .form-group > .control-label {
    flex: 0 0 190px;
    max-width: 190px;
    text-align: right;
    padding-right: 12px;
    color: #222c64;
    font-weight: 600;
}

.rm-inline-form .form-group > .col-md-10 {
    flex: 1 1 0;
}

.rm-inline-form .form-group > .col-md-offset-2 {
    margin-left: 190px;
}

@media (max-width: 767.98px) {
    .rm-inline-form .form-group {
        display: block;
    }

    .rm-inline-form .form-group > .control-label {
        text-align: left;
        padding-right: 0;
        max-width: none;
    }

    .rm-inline-form .form-group > .col-md-offset-2 {
        margin-left: 0;
    }
}

.rm-form-panel .btn,
.rm-detail-panel .btn {
    margin-right: 6px;
}

/* Legacy parity: Bootstrap 3 text-danger validation (MVC ValidationSummary / ValidationMessageFor) */
.rm-form-panel .validation-summary-errors,
.rm-inline-form .validation-summary-errors,
.rm-form-panel .validation-message,
.rm-inline-form .validation-message {
    color: var(--bs-danger, #dc3545);
}

.rm-form-panel .validation-message,
.rm-inline-form .validation-message {
    display: block;
    margin-top: 4px;
    font-size: 0.875em;
}

.rm-form-panel .validation-summary-errors,
.rm-inline-form .validation-summary-errors {
    margin-bottom: 1rem;
}

.rm-form-panel .validation-summary-errors ul,
.rm-inline-form .validation-summary-errors ul {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

/* Location picker (legacy Bootstrap 3 parity) */
.location-picker {
    position: relative;
    display: block;
    width: 100%;
}

.location-picker .location-picker-display {
    display: block;
    height: 34px;
    padding: 6px 58px 6px 12px;
    width: 100%;
    font-size: 14px;
    line-height: 1.42857143;
    color: #555555;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    cursor: text;
}

.location-picker .location-picker-display:focus {
    border-color: #66afe9;
    outline: 0;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
}

.location-picker .location-picker-btn {
    position: absolute;
    top: 0;
    height: 34px;
    width: 29px;
    border: 0;
    background: transparent;
    color: #555;
    line-height: 1;
    padding: 0;
}

.location-picker .location-picker-clear {
    right: 29px;
    font-size: 18px;
    opacity: 0.75;
}

.location-picker .location-picker-toggle {
    right: 0;
    border-left: 1px solid #ccc;
    background: linear-gradient(#fafafa, #eee);
    border-radius: 0 4px 4px 0;
}

.location-picker .caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 2px;
    vertical-align: middle;
    border-top: 4px solid #555;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

.location-picker.open .location-picker-toggle .caret {
    transform: rotate(180deg);
}

.location-picker .location-picker-dropdown {
    display: none;
    float: left;
    min-width: 100%;
    padding: 0;
    margin: 2px 0 0;
    font-size: 14px;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
}

.location-picker.open .location-picker-dropdown {
    display: block;
}

.location-picker .js-location-dropdown-search {
    height: 30px;
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
    border: 1px solid #ccc;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}

.location-picker .location-item > a {
    display: block;
    padding: 6px 12px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-picker .location-item.active > a,
.location-picker .location-item > a:hover {
    background: #f5f5f5;
}

@media (min-width: 768px) {
    .rm-detail-dl {
        margin-bottom: 0;
    }

    .rm-detail-dl dt {
        float: left;
        width: 190px;
        clear: left;
        text-align: right;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding-right: 12px;
    }

    .rm-detail-dl dd {
        margin-left: 202px;
        min-height: 20px;
    }
}

.card {
    border-radius: 4px;
    border: 1px solid #ddd;
    box-shadow: none;
}

@media (max-width: 991.98px) {
    .admin-users-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .admin-users-stats {
        grid-template-columns: 1fr;
    }

    .admin-users-header {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 1024px) {
    :root {
        --nav-width: 230px;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: relative;
        height: auto;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .app-main {
        min-height: auto;
    }
}

