form {
    background: none !important;
}
.ch-spinner {
    width: 20px;
    height: 20px;
    margin-left: 10px;
    vertical-align: middle;
    background-image: url('/assets/img/spinner5.gif');
    background-repeat: no-repeat;
    background-size: contain;
    display: inline-block;
    position: absolute;

    z-index: 10;
}
.ch-spinner-normal {
    width: 50px;
    height: 50px;
    margin-top: -20px;
}
.ch-spinner-select {
    top: 5px;
    right: 30px;

}
.ch-spinner-button-left {
    top: 5px;
    left: -20px;
}


.form-control {
    height: calc(1em + .75rem + 3px);
    padding: .175rem .3rem;
    max-width: 300px;
    color: #f8f9fa;
}
.form-widget {
    width: 138%;
}
/* light theme: inputs must use dark text (the .form-control color above is for dark themes) */
body.theme-default .form-control,
body.theme-default input:not(.btn),
body.theme-default select,
body.theme-default textarea {
    color: #212529;
}
.hide {
    display: none;
}

.card {
    max-width: 1500px;
}
.card-header {
    padding: .2rem .5rem;
}
.card-footer {
    padding: .2rem .5rem
}
#edit-messageconfig-form textarea {
    max-width: 100% !important;
}
li.active a {
    font-weight: bold;
    text-decoration: underline;
}
.green {
    color: #91f691;
}

.red {
    color: #f87dca;
}

.blue {
    color: #6cd5f5;
}
.grey {
    color: #c6c6c6;
}
body.theme-default .grey {
    color: #4a4848;
}

.row {
    padding: 10px;
}
tr.text-dark input,
tr.text-dark select,
tr.text-dark textarea
{
    color: black;
}
label.required:before {
    content: "* ";
    color: #f691c7;
    font-size: large;
}

th.required:after {
    content: " * ";
    color: #f691c7;
    font-size: large;
    white-space: nowrap;
}

.btn-secondary {
    color: #f8f9fa !important;
}
.datepicker {
    z-index: 1151 !important;
}
.test-mode {
    background: #f65674;
    color: white;
    text-align: center;
    font-weight: bold;
	position: absolute;
    float: left;
    left: 260px;
	border-radius: 3px;
	padding:5px 20px;
}
.choices__input {
    min-width: 200px;
    padding: 4px 0 4px 4px !important;
    border-radius: 5px !important;
}
.choices__inner {
    background-color: transparent !important;
    border-radius: 5px !important;
    border: 1px solid #495057 !important;
}

.text-dark .choices__inner input {
    color: #383838 !important;
}
.choices__inner input {
    background-color: transparent !important;
}
.choices__list--dropdown {
    background-color: #383839 !important;
    color: #ced4da;
    z-index: 100 !important;
}
.is-highlighted {
    background-color: #1791ba !important;
    color: white;
}

::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
    color: #bbbbbb !important;
    opacity: 1; /* Firefox */
}

:-ms-input-placeholder { /* Internet Explorer 10-11 */
    color: black !important;
}

::-ms-input-placeholder { /* Microsoft Edge */
    color: black !important;
}

/* light theme: placeholders need a darker grey to stay readable on white */
body.theme-default ::placeholder,
body.theme-default .form-control::placeholder {
    color: #6c757d !important;
}

/* light theme: visible border on the active card tab */
body.theme-default .card.card-tabs .nav-tabs .nav-link.active {
    border-color: #dee2e6;
}

.choices__list--multiple .choices__item {
    border-radius: 2px !important;
}
.choices > .choices__list > .choices__list > .choices__item--selectable
{
    padding-right: 0 !important;
}
.choices > .choices__list > .choices__list > .choices__item--selectable::after
{
    display: none !important;
}
a.action-show {
    margin: 0 10px;
}
.form-control-label, .col-form-label {
    margin-top: 15px !important;
}
.pr-0, .px-0 {
    padding-right: 10px !important;
}
.toggle-handle {
    background-color: #92969b;
}
.toggle.btn {
    min-height: 30px !important;
}
/* the sides are <label>s, so theme rules like "body.theme-default label" out-specify
   .btn-dark/.btn-light — pin the button colors so "Dark" stays white on its dark pill */
.toggle .toggle-on.btn-dark {
    color: #f8f9fa;
}
.toggle .toggle-off.btn-light {
    color: #6c757d;
}
/* Dashboard header: title, currency switch and tutorials on one line, wrapping on small screens */
.dashboard-content-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 30px;
}
.dashboard-content-header .title {
    margin-bottom: 0;
}
.functional-currency {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
}
.functional-currency-switch {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
}
.functional-currency-help {
    white-space: nowrap;
}
/* Logged-in info at the top of the sidebar: mobile only, desktop keeps the header version */
.sidebar-logged {
    display: none;
    padding: 12px 16px 10px;
    font-size: 13px;
    line-height: 1.6;
    border-bottom: 1px solid rgba(128, 128, 128, .35);
}
.sidebar-logged small {
    color: #787878;
    margin-right: 6px;
}
/* logout link in the sidebar is a mobile-only fallback for the header button */
.sidebar-logged .sidebar-logout {
    display: none;
    margin-top: 4px;
}
/* Mobile header: toggle, logo and logout only */
@media screen and (max-width: 768px) {
    .test-mode {
        display: none;
    }
    /* menu toggle sits at the far right, where the logout button used to be */
    .header > .header-bar {
        grid-template-columns: 1fr auto 60px;
    }
    .header .header-bar .brand {
        grid-column: 1 !important;
        grid-row: 1;
    }
    .header > .header-bar .navigation {
        grid-column: 2;
        grid-row: 1;
    }
    .header .header-bar .btn-toggle {
        grid-column: 3;
        grid-row: 1;
        text-align: center;
    }
    .header > .header-bar .navigation .navbar-menu .menu-item {
        width: auto;
    }
    .header > .header-bar .navigation .navbar-menu .menu-item .btn,
    body.theme-dark .header > .header-bar .navigation .navbar-menu .menu-item .btn,
    body.theme-blue .header > .header-bar .navigation .navbar-menu .menu-item .btn {
        border-left: none;
    }
    /* hide logged info, profile (invite), help and logout buttons; sms and email stay */
    .header .navbar-menu #logged,
    .header .navbar-menu #new-learn,
    .header .navbar-menu .menu-item:has(> a[href="/logout"]) {
        display: none;
    }
    /* logged info and logout move to the sidebar on mobile */
    .sidebar-logged {
        display: block;
    }
    .sidebar-logged .sidebar-logout {
        display: inline-block;
        float: right;
    }
}
@media screen and (max-width: 480px) {
    /* siqtheme swaps the brand logo for .logo-sm on phones — use the brand logo instead */
    a.logo-sm {
        display: none !important;
    }
    .header .brand a.logo {
        display: inline-block;
    }
    .header .brand a.logo img {
        max-height: 40px;
    }
}
/* Small devices (tablets, 768px and up) */
@media (min-width:768px) {
    td, th {
        font-size: 10px !important;
    }
}

/* Medium devices (desktops, 992px and up) */
@media (min-width: 992px) {
    td, th {
        font-size: 12px !important;
    }
}

/* Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
   td, th {
        font-size: 14px !important;
    }
}

.ck-content, .ck-editor__editable {
    color: #0a0a0a;
}

.checkbox-switch input {
    display: block !important;
}
/* form-checkbox switches used inline next to a separate text <label> must not force a line break */
.checkbox-switch.form-checkbox {
    display: inline-block;
    vertical-align: middle;
}
/* bootstrap-toggle renders the widget itself; the raw checkbox inside must stay hidden */
.toggle input[type=checkbox] {
    display: none !important;
}

.switcher input[type=checkbox], .switcher-roi input[type=checkbox] {
    display: none !important;
}
.switcher-roi input[type=checkbox] {
    display: none !important;
}
body.theme-dark .table-hover tbody tr:hover {
    color: #adb5bd;
    background-color: #26455b;
}
.main {
    min-height: 700px;
    overflow-x: unset;
}
.list-group-item {
    background-color: transparent !important;
}
.selector-for-some-widget {
    box-sizing: content-box;
}
.dropdown-header {
    display: none;
}
body.theme-dark .dark li a {
    color: #ffffff !important;
}
body.theme-default .dark li a {
    color: #212529 !important;
}
.bootstrap-select .dropdown-menu li a.opt {
    padding-left: 1.5em !important;
}
.dropdown-item {
    padding: 0.25rem !important;
}
.filter-option {
    height: 17px !important;
}
.form-help:before, label:after {
    content: "\A"; /* Inserts a line break */
    white-space: pre; /* Ensures the line break is rendered */
}
.required:before {
    content: "* ";
    color: #f691c7;
    font-size: large;
}

#new-user-form .form-group {
    margin: 0.5rem;
}
.filter-option-inner {
    margin-top: -4px;
}
body.theme-default label {
    color: #212529;
}
/* Dashboard (stats) cards and other pages: titles and labels need dark text in light mode.
   Not scoped to #wrapper — that id only exists on the vendor EasyAdmin layout, not on
   the project's custom layout.html.twig used by instrument pages (e.g. cashflow-forward) */
body.theme-default .text-secondary {
    color: #4d4d4d !important;
}
/* base taffy pink (#f987c5) is unreadable on light backgrounds — use a darker magenta */
body.theme-default .text-taffy,
body.theme-default a.text-taffy:focus,
body.theme-default a.text-taffy:hover {
    color: #ba0d6b !important;
}
/* base warning outline (#e8ba30) is too light on white — use a darker gold */
body.theme-default .btn-outline-warning {
    color: #c59608;
    border-color: #c59608;
}
body.theme-default .btn-outline-warning:hover,
body.theme-default .btn-outline-warning:not(:disabled):not(.disabled).active,
body.theme-default .btn-outline-warning:not(:disabled):not(.disabled):active,
body.theme-default .show > .btn-outline-warning.dropdown-toggle {
    color: #f8f9fa;
    background-color: #c59608;
    border-color: #c59608;
}
body.theme-default .btn-outline-warning.focus,
body.theme-default .btn-outline-warning:focus,
body.theme-default .btn-outline-warning:not(:disabled):not(.disabled).active:focus,
body.theme-default .btn-outline-warning:not(:disabled):not(.disabled):active:focus,
body.theme-default .show > .btn-outline-warning.dropdown-toggle:focus {
    box-shadow: 0 0 0 .2rem rgba(197, 150, 8, .5);
}
body.theme-default table thead tr {
    background-color: aliceblue;
}
body.theme-default .card-header {
    background-color: ghostwhite;
}
body.theme-default #modal-header {
    background-color: ghostwhite;
}
/* cashflow chart gauge arrow: base #d1d4dc is unreadable on light backgrounds */
body.theme-default .cashflow_chart .arrow {
    top: 55%;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 90px solid #6d717b;
}
body.theme-default .btn-outline-warning.disabled,
body.theme-default .btn-outline-warning:disabled {
    color: #c59608;
    background-color: transparent;
}
body.theme-default #wrapper .card-body {
    color: #212529;
}
body.theme-default select,
body.theme-default select option {
    color: #212529;
}
/* Light mode: light body and header, dark text and icons in header */
body.theme-default {
    background: #e9ecef;
    color: #333434;
}
body.theme-default .header {
    background-color: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}
body.theme-default .header > .header-bar,
body.theme-default .header > .header-bar a,
body.theme-default .header > .header-bar .navbar-menu .menu-item .btn {
    color: #212529;
}
body.theme-default .header > .header-bar .navigation .navbar-menu .menu-item .btn:focus {
    background: #ced4da;
}
/* logo_only.jpg has a white background — blend it into the grey header */
body.theme-default .header .logo-sm img {
    mix-blend-mode: multiply;
}
/* "Logged to company" block uses inline colors tuned for the dark header */
body.theme-default .header #logged div {
    color: #495057 !important;
    font-weight: bolder;
}
body.theme-default .header #logged small {
    color: #6c757d !important;
}
/* Selected rows: mustard is unreadable on light backgrounds — use forest green */
body.theme-default .text-mustard {
    color: #0b6623 !important;
}
body.theme-default a.text-mustard:focus,
body.theme-default a.text-mustard:hover {
    color: #04210b !important;
}
/* Orders: expired rows use .text-white-50, invisible on a light background */
body.theme-default .text-white-50 {
    color: rgba(0, 0, 0, .5) !important;
}
/* Select fields need dark borders in light mode */
body.theme-default select,
body.theme-default select.form-control,
body.theme-default .bootstrap-select > .dropdown-toggle,
body.theme-default .choices__inner {
    border-color: #495057;
}
/* Currency dropdown (forward_currency) items use .text-light, unreadable on the light dropdown-menu background */
body.theme-default .input-group-append .dropdown-item,
body.theme-default .input-group-append .dropdown-item .text-light {
    color: #212529 !important;
}
/* Card-header tabs: same sizing/structure as dark mode, light colors kept */
body.theme-default .card .card-header {
    padding: .75rem 1.25rem;
}
body.theme-default .card.card-tabs .nav-tabs .nav-item .nav-link:hover {
    border: 1px solid transparent;
}
.content-footer {
    margin: 30px;
}

/* fullCalendar custom styles */
:root {
    --fc-border-color: #747373 !important;
    --fc-button-text-color: #fff;
    --fc-button-bg-color: none;
    --fc-button-border-color: #57a0d2;
    --fc-button-hover-bg-color: #57a0d2;
    --fc-button-hover-border-color: #57a0d2;
    --fc-button-active-bg-color: #57a0d2;
    --fc-button-active-border-color: #57a0d2;
    --fc-page-bg-color: #1b1a1a;
}
.fc--button {
    display: none !important;
}
body.theme-default .fc-button-primary,
body.theme-default .fc-button-primary:disabled {
    color: var(--fc-button-border-color);
}
.fc-popover {
    background: #1b1a1a !important;
    border: 1px solid #5e5e5e !important;
}
.fc-list-event:hover td, .fc-list-day-cushion {
    background-color: rgba(27, 26, 26, 0.82) !important; /* Use !important as a last resort */
}
.fc-event-title-container {
    margin: 0px 2px !important;
    font-weight: bold;
}
.fc-daygrid-event-harness {
    padding: 0px 5px !important;
}
.fc-event-main:hover {
    background-color: #57a0d2;
}
.bg-grey {
    background-color: #ededed !important;
}
.border-grey {
    border-color: #9e9e9e !important;
}
.footer,
body.theme-dark .footer,
body.theme-blue .footer {
    background: none !important;
}

@media (max-width: 768px) {
    /* desktop needs .main { overflow-x: unset } (see above) but on phones that
       lets a wide datagrid stretch the whole page and the browser zooms out to
       fit ("everything tiny in half the screen") — re-contain .main and let the
       grid/flex chain shrink so the table scrolls inside .content-body instead */
    .main {
        overflow-x: hidden;
        min-width: 0;
    }
    .content {
        min-width: 0;
    }

    body .text-taffy,
    body a.text-taffy:focus,
    body a.text-taffy:hover {
        color: #4a4a4a !important;
    }

    /* half-transparent white rows (e.g. expired alerts) are invisible on the light theme */
    body.theme-default tr.text-white-50,
    body.theme-default tr.text-white-50 td {
        color: inherit !important;
    }

    /* entity forms (e.g. /admin/?entity=Counterparty&action=new): the desktop
       .form-widget width hack (138%) pushes fields past the screen edge once
       the form groups stack full-width */
    .form-widget {
        width: 100%;
    }
    .form-control {
        max-width: 100%;
    }
    .field-group {
        margin-bottom: 1rem;
    }

    /* wide tables (entity datagrids, portfolio/accounting/instrument tables) have
       no responsive wrapper, so they'd push past the screen edge and get clipped
       by .main — scroll them inside the content body instead, on every page */
    .content-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .list .table.datagrid th,
    .list .table.datagrid td {
        white-space: nowrap;
    }

    /* collection columns (e.g. Customer list: currency pairs, tags, admins) would
       make a nowrap row absurdly wide — let those cells wrap instead */
    .list .table.datagrid td.association,
    .list .table.datagrid td.array,
    .list .table.datagrid td.simple_array,
    .list .table.datagrid td.json_array {
        white-space: normal;
        min-width: 160px;
    }

    /* let the page title and the search/new actions stack instead of squeezing
       into one row */
    .content-header > .d-flex {
        flex-wrap: wrap;
        gap: 5px 15px;
    }

    /* tabbed pages (Analytics strategies, AI advisor, Accounting, Orders,
       Settings…): tab bar becomes one scrollable row, wide content scrolls
       inside the pane — same treatment the instrument wizards already use */
    .card-tabs .card-header-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .card-tabs .card-header-tabs .nav-link {
        white-space: nowrap;
    }
    .card-tabs .tab-pane {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* period switcher (All/Current/Historical) floats right on desktop —
       full-width row on phones */
    .card-tabs .tab-pane .instruments {
        float: none !important;
        width: 100% !important;
        margin: 0 0 10px;
        text-align: left;
    }
    /* several bundle stylesheets pin desktop-sized toasts (min-width: 500px) */
    .toast {
        min-width: 0 !important;
        max-width: calc(100vw - 30px);
    }
}
