:root, [data-bs-theme="light"], .theme-blue {
    --bs-primary: #1b55e2 !important; /* Main Blue */
    --bs-primary-rgb: 27, 85, 226 !important;
    --bs-body-bg: #f4f7f9 !important; /* Light grayish-blue background */
    --bs-body-color: #334155 !important; /* Slate 700 */
    --bs-heading-color: #0f172a !important; /* Slate 900 */
    --bs-card-bg: #ffffff !important;
    --bs-border-color: #e2e8f0 !important;
    --bs-btn-bg: #1b55e2 !important;
    --bs-btn-border-color: #1b55e2 !important;
    --bs-btn-hover-bg: #1444bc !important;
    --bs-btn-hover-border-color: #1444bc !important;
}

/* Base Body */
body {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

/* Sidebar & Navbar */
.menu-vertical, .layout-navbar {
    background-color: #ffffff !important;
    /* border-right: 1px solid var(--bs-border-color) !important;
    border-bottom: 1px solid var(--bs-border-color) !important; */
}

.menu-item.active:not(.open) > .menu-link {
    background: #e8efff !important; /* Use 'background' to override any linear-gradient */
    background-color: #e8efff !important;
    color: #1b55e2 !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    margin: 0 10px !important;
    box-shadow: none !important;
}

.menu-item.active:not(.open) > .menu-link i,
.menu-item.active:not(.open) > .menu-link svg,
.menu-item.active:not(.open) > .menu-link::before {
    color: #1b55e2 !important;
    background-color: #1b55e2 !important;
}

.menu-item .menu-link {
    color: #475569 !important;
    border-radius: 8px !important;
    margin: 0 10px !important;
    transition: all 0.2s ease !important;
}

.menu-item .menu-link:hover {
    background: #e8efff !important;
    background-color: #e8efff !important;
    color: #1b55e2 !important;
}

.menu-item .menu-link:hover i,
.menu-item .menu-link:hover svg {
    color: #1b55e2 !important;
}

.menu-inner-shadow {
    display: none !important;
}

/* Cards */
.content-wrapper .card {
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: none !important;
}

.content-wrapper .card:hover {
    transform: none !important; /* Prevent card from jumping up */
    box-shadow: none !important;
}

.content-wrapper .card:hover .lp-section-icon {
    transform: none !important;
}

/* Buttons */
.btn {
    border-radius: 8px !important;
    font-weight: 600 !important;
}

.btn-primary {
    background-color: #1b55e2 !important;
    border-color: #1b55e2 !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: #1444bc !important;
    border-color: #1444bc !important;
}

/* Remove background from icon buttons (like 3 vertical dots) on hover */
.btn.text-body-secondary.p-0:hover,
.card-header .btn.p-0:hover {
    background-color: transparent !important;
    color: #1b55e2 !important;
}

/* Text Colors */
h1, h2, h3, h4, h5, h6, .card-title, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: #0f172a !important;
    font-weight: 700 !important;
}

.text-muted {
    color: #64748b !important;
}

/* Input Fields */
.form-control, .form-select, .input-group-text {
    border-radius: 8px; /* Removed !important to allow input-group overrides */
    border-color: #cbd5e1;
    background-color: #ffffff;
    color: #334155;
}

.input-group > .form-control {
    border-radius: 8px; /* Allow input group to handle the specific corners */
}

/* Important: In RTL, the icon is on the left. In LTR, icon is on the right.
   Bootstrap handles border-radius, so we just let it be. */

.form-control:focus, .form-select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15) !important;
}

.input-group:focus-within .form-control,
.input-group:focus-within .input-group-text {
    border-color: #3b82f6 !important;
}

.input-group:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15) !important;
    border-radius: 8px;
}

.input-group-merge:focus-within .form-control {
    box-shadow: none !important; /* Move box-shadow to the group */
}

/* Ensure the border between input and icon is hidden in merge */
[dir="rtl"] .input-group-merge .form-control:focus {
    border-left-color: transparent !important;
}
[dir="ltr"] .input-group-merge .form-control:focus {
    border-right-color: transparent !important;
}

/* Table */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    color: #475569 !important;
    background-color: #f8fafc !important;
    font-weight: 700 !important;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 12px 16px !important;
}

.table td {
    vertical-align: middle !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 12px 16px !important;
}

.table-dark {
    --bs-table-bg: #f8fafc !important;
    --bs-table-color: #475569 !important;
    background-color: #f8fafc !important;
}

.table-dark th,
.table-dark td {
    background-color: #f8fafc !important;
    color: #475569 !important;
    font-weight: 700 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

.table-dark td.text-success {
    color: #28c76f !important;
}

.table-dark td.text-danger {
    color: #ea5455 !important;
}

/* Badges */
.badge {
    border-radius: 6px !important;
    font-weight: 600 !important;
    padding: 0.4em 0.8em !important;
}

/* Removed helpers that broke opacity */

/* revenue stats card styles  */
.revenue-stats-card {
    background-color: #1e293b !important;
}

.revenue-stats-card .settings-icon {
    background-color: #1b55e2 !important;
}

.payment-methods-table td {
    color: #ffffff !important;
}

/* ========================================================
   Floating Outline Labels Fix
   Ensures floating labels sit directly on the outline notch
   with proper background mask, vertical alignment, and RTL support
   ======================================================== */

.form-floating.form-floating-outline > label,
.input-group.form-floating.form-floating-outline > label,
.input-group .form-floating.form-floating-outline > label {
    transition: transform 0.15s ease-in-out, font-size 0.15s ease-in-out, color 0.15s ease-in-out, background-color 0.15s ease-in-out !important;
}

/* Remove default pseudo-element notch if any */
.form-floating.form-floating-outline > .form-control ~ label::after,
.form-floating.form-floating-outline > .form-select ~ label::after,
.input-group.form-floating.form-floating-outline > .form-control ~ label::after,
.input-group.form-floating.form-floating-outline > .form-select ~ label::after,
.input-group .form-floating.form-floating-outline > .form-control ~ label::after,
.input-group .form-floating.form-floating-outline > .form-select ~ label::after {
    display: none !important;
}

/* Active / Floating state (focused, has value, select, or autofill) */
.form-floating.form-floating-outline > .form-control:focus ~ label,
.form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
.form-floating.form-floating-outline > .form-control:-webkit-autofill ~ label,
.form-floating.form-floating-outline > .form-select:focus ~ label,
.form-floating.form-floating-outline > .form-select:not(:placeholder-shown) ~ label,
.form-floating.form-floating-outline > .form-select ~ label,
.input-group.form-floating.form-floating-outline > .form-control:focus ~ label,
.input-group.form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
.input-group.form-floating.form-floating-outline > .form-control:-webkit-autofill ~ label,
.input-group.form-floating.form-floating-outline > .form-select ~ label,
.input-group .form-floating.form-floating-outline > .form-control:focus ~ label,
.input-group .form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
.input-group .form-floating.form-floating-outline > .form-control:-webkit-autofill ~ label,
.input-group .form-floating.form-floating-outline > .form-select ~ label {
    top: 0 !important;
    bottom: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    margin-block-start: 0 !important;
    transform: translateY(-50%) !important;
    font-size: 0.8125rem !important;
    line-height: 1.2 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-inline: 6px !important;
    background-color: var(--bs-card-bg, #ffffff) !important;
    border-radius: 4px !important;
    z-index: 5 !important;
    opacity: 1 !important;
    width: auto !important;
    max-width: calc(100% - 1.5rem) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    pointer-events: none !important;
    color: var(--bs-body-color, #475569) !important;
    font-weight: 500 !important;
}

/* RTL Specific Positioning */
[dir="rtl"] .form-floating.form-floating-outline > .form-control:focus ~ label,
[dir="rtl"] .form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
[dir="rtl"] .form-floating.form-floating-outline > .form-control:-webkit-autofill ~ label,
[dir="rtl"] .form-floating.form-floating-outline > .form-select:focus ~ label,
[dir="rtl"] .form-floating.form-floating-outline > .form-select:not(:placeholder-shown) ~ label,
[dir="rtl"] .form-floating.form-floating-outline > .form-select ~ label,
[dir="rtl"] .input-group.form-floating.form-floating-outline > .form-control:focus ~ label,
[dir="rtl"] .input-group.form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
[dir="rtl"] .input-group.form-floating.form-floating-outline > .form-control:-webkit-autofill ~ label,
[dir="rtl"] .input-group.form-floating.form-floating-outline > .form-select ~ label,
[dir="rtl"] .input-group .form-floating.form-floating-outline > .form-control:focus ~ label,
[dir="rtl"] .input-group .form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
[dir="rtl"] .input-group .form-floating.form-floating-outline > .form-control:-webkit-autofill ~ label,
[dir="rtl"] .input-group .form-floating.form-floating-outline > .form-select ~ label,
:dir(rtl) .form-floating.form-floating-outline > .form-control:focus ~ label,
:dir(rtl) .form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
:dir(rtl) .form-floating.form-floating-outline > .form-control:-webkit-autofill ~ label,
:dir(rtl) .form-floating.form-floating-outline > .form-select:focus ~ label,
:dir(rtl) .form-floating.form-floating-outline > .form-select:not(:placeholder-shown) ~ label,
:dir(rtl) .form-floating.form-floating-outline > .form-select ~ label,
:dir(rtl) .input-group.form-floating.form-floating-outline > .form-control:focus ~ label,
:dir(rtl) .input-group.form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
:dir(rtl) .input-group.form-floating.form-floating-outline > .form-control:-webkit-autofill ~ label,
:dir(rtl) .input-group.form-floating.form-floating-outline > .form-select ~ label,
:dir(rtl) .input-group .form-floating.form-floating-outline > .form-control:focus ~ label,
:dir(rtl) .input-group .form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
:dir(rtl) .input-group .form-floating.form-floating-outline > .form-control:-webkit-autofill ~ label,
:dir(rtl) .input-group .form-floating.form-floating-outline > .form-select ~ label {
    right: 0.75rem !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    transform-origin: right top !important;
}

/* LTR Specific Positioning */
[dir="ltr"] .form-floating.form-floating-outline > .form-control:focus ~ label,
[dir="ltr"] .form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
[dir="ltr"] .form-floating.form-floating-outline > .form-control:-webkit-autofill ~ label,
[dir="ltr"] .form-floating.form-floating-outline > .form-select:focus ~ label,
[dir="ltr"] .form-floating.form-floating-outline > .form-select:not(:placeholder-shown) ~ label,
[dir="ltr"] .form-floating.form-floating-outline > .form-select ~ label,
[dir="ltr"] .input-group.form-floating.form-floating-outline > .form-control:focus ~ label,
[dir="ltr"] .input-group.form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
[dir="ltr"] .input-group.form-floating.form-floating-outline > .form-control:-webkit-autofill ~ label,
[dir="ltr"] .input-group.form-floating.form-floating-outline > .form-select ~ label,
[dir="ltr"] .input-group .form-floating.form-floating-outline > .form-control:focus ~ label,
[dir="ltr"] .input-group .form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
[dir="ltr"] .input-group .form-floating.form-floating-outline > .form-control:-webkit-autofill ~ label,
[dir="ltr"] .input-group .form-floating.form-floating-outline > .form-select ~ label,
:dir(ltr) .form-floating.form-floating-outline > .form-control:focus ~ label,
:dir(ltr) .form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
:dir(ltr) .form-floating.form-floating-outline > .form-control:-webkit-autofill ~ label,
:dir(ltr) .form-floating.form-floating-outline > .form-select:focus ~ label,
:dir(ltr) .form-floating.form-floating-outline > .form-select:not(:placeholder-shown) ~ label,
:dir(ltr) .form-floating.form-floating-outline > .form-select ~ label,
:dir(ltr) .input-group.form-floating.form-floating-outline > .form-control:focus ~ label,
:dir(ltr) .input-group.form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
:dir(ltr) .input-group.form-floating.form-floating-outline > .form-control:-webkit-autofill ~ label,
:dir(ltr) .input-group.form-floating.form-floating-outline > .form-select ~ label,
:dir(ltr) .input-group .form-floating.form-floating-outline > .form-control:focus ~ label,
:dir(ltr) .input-group .form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
:dir(ltr) .input-group .form-floating.form-floating-outline > .form-control:-webkit-autofill ~ label,
:dir(ltr) .input-group .form-floating.form-floating-outline > .form-select ~ label {
    left: 0.75rem !important;
    right: auto !important;
    transform: translateY(-50%) !important;
    transform-origin: left top !important;
}

/* Focused State: Highlight label with primary color */
.form-floating.form-floating-outline > .form-control:focus ~ label,
.form-floating.form-floating-outline > .form-select:focus ~ label,
.input-group.form-floating.form-floating-outline > .form-control:focus ~ label,
.input-group.form-floating.form-floating-outline > .form-select:focus ~ label,
.input-group .form-floating.form-floating-outline > .form-control:focus ~ label,
.input-group .form-floating.form-floating-outline > .form-select:focus ~ label {
    color: var(--bs-primary) !important;
    font-weight: 600 !important;
}

/* Invalid State: Highlight label with danger color */
.form-floating.form-floating-outline > .form-control.is-invalid ~ label,
.form-floating.form-floating-outline > .form-select.is-invalid ~ label,
.input-group.form-floating.form-floating-outline > .form-control.is-invalid ~ label,
.input-group.form-floating.form-floating-outline > .form-select.is-invalid ~ label,
.input-group .form-floating.form-floating-outline > .form-control.is-invalid ~ label,
.input-group .form-floating.form-floating-outline > .form-select.is-invalid ~ label,
.was-validated .form-floating.form-floating-outline > .form-control:invalid ~ label,
.was-validated .form-floating.form-floating-outline > .form-select:invalid ~ label {
    color: var(--bs-danger, #ff4d49) !important;
}

/* Dark Mode Background override */
[data-bs-theme="dark"] .form-floating.form-floating-outline > .form-control:focus ~ label,
[data-bs-theme="dark"] .form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
[data-bs-theme="dark"] .form-floating.form-floating-outline > .form-select:focus ~ label,
[data-bs-theme="dark"] .form-floating.form-floating-outline > .form-select:not(:placeholder-shown) ~ label,
[data-bs-theme="dark"] .form-floating.form-floating-outline > .form-select ~ label,
[data-bs-theme="dark"] .input-group.form-floating.form-floating-outline > .form-control:focus ~ label,
[data-bs-theme="dark"] .input-group.form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
[data-bs-theme="dark"] .input-group .form-floating.form-floating-outline > .form-control:focus ~ label,
[data-bs-theme="dark"] .input-group .form-floating.form-floating-outline > .form-control:not(:placeholder-shown) ~ label {
    background-color: var(--bs-paper-bg, #202638) !important;
}

