/* ========== UI COMPONENTS ========== */

.uk-fieldset {
    box-shadow: 0px -0.5px 1px 0px rgba(255, 255, 255, 0.30) inset, 0px -0.5px 1px 0px rgba(255, 255, 255, 0.25) inset, 1px 1.5px 4px 0px rgba(0, 0, 0, 0.08) inset, 1px 1.5px 4px 0px rgba(0, 0, 0, 0.10) inset;
    border-radius: var(--16, 16px);
    padding: 12px;
}

.uk-fieldset > label {
    padding: var(--uk-form-input-padding);
    font-size: 80%;
}

/* ========== NETWORK VISUALIZATION ========== */

div.vis-network div.vis-manipulation {
    background: transparent !important;
}

div.vis-network div.vis-edit-mode button.vis-button.vis-edit.vis-edit-mode {
    background-color: transparent !important;
    border: none !important;
}

button {
    cursor: pointer;
}

.highcharts-background {
    fill: transparent !important;
}

.CodeMirror {
    font-family: 'Anonymous Pro', 'Courier New', Consolas, Monaco, monospace;
}

.uk-btn {
    cursor: pointer;
}

.admin-dashboard .uk-badge {
    color: white;
}

html .uk-divider-vertical {
    border-color: hsl(var(--primary));
}

.uk-btn-group.border {
    border-color: hsl(var(--primary));
}

html:not(.dark) td.dtfc-fixed-left {
    color: #171717;
}

html:not(.dark) td.dtfc-fixed-left .uk-link {
    color: oklch(0.457 0.24 277.023);
}

html:not(.dark) .text-white .uk-link {
    color: oklch(0.901 0.058 230.902);
}

html:not(.dark) .menu-active {
    background: hsl(var(--primary)) !important;
}

html:not(.dark) .menu-active a {
    color: hsl(var(--accent));
}

/*html.dark .main-gradient {*/
/*    background: linear-gradient(180deg, rgba(204, 204, 204, 0.07), rgba(38, 33, 73, 0)), radial-gradient(51.83% 94.53% at 58.78% 107.81%, hsla(261, 70%, 46%, 0.44) 0, rgba(38, 33, 73, 0) 100%);*/
/*}*/

/*html:not(.dark) .main-gradient {*/
/*    backdrop-filter: blur(1000px);*/
/*    background: transparent;*/
/*}*/

.dt-scroll-head {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.uk-flex-inline {
    display: inline-flex
}

.uk-flex-inline::after,.uk-flex-inline::before,.uk-flex::after,.uk-flex::before {
    display: none
}

.uk-flex-left {
    justify-content: flex-start
}

.uk-flex-center {
    justify-content: center
}

.uk-flex-right {
    justify-content: flex-end
}

.uk-flex-between {
    justify-content: space-between
}

.uk-flex-around {
    justify-content: space-around
}

.uk-pagination {
    display: flex;
    flex-wrap: wrap;
    margin-left: -20px;
    padding: 0;
    list-style: none
}

.uk-pagination>* {
    flex: none;
    padding-left: 20px;
    position: relative
}

.uk-pagination>*>* {
    display: block;
    color: #999;
    transition: color .1s ease-in-out
}

.uk-pagination>*>:focus,.uk-pagination>*>:hover {
    color: #666;
    text-decoration: none
}

.uk-pagination>.uk-active>* {
    color: #666
}

.uk-pagination>.uk-disabled>* {
    color: #999
}

[class*=uk-width] {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%
}

.uk-width-1-2 {
    width: 50%
}

.uk-width-1-3 {
    width: calc(100% * 1 / 3.001)
}

.uk-width-2-3 {
    width: calc(100% * 2 / 3.001)
}

.uk-width-1-4 {
    width: 25%
}

.uk-width-3-4 {
    width: 75%
}

.uk-width-1-5 {
    width: 20%
}

.uk-width-2-5 {
    width: 40%
}

.uk-width-3-5 {
    width: 60%
}

.uk-width-4-5 {
    width: 80%
}

.uk-width-1-6 {
    width: calc(100% * 1 / 6.001)
}

.uk-width-5-6 {
    width: calc(100% * 5 / 6.001)
}

.uk-width-small {
    width: 150px
}

.uk-width-medium {
    width: 300px
}

.uk-width-large {
    width: 450px
}

.uk-width-xlarge {
    width: 600px
}

.uk-width-xxlarge {
    width: 750px
}

.uk-width-auto {
    width: auto
}


.uk-btn-group.gap-1 {
    box-shadow: none;
    overflow-x: auto;
    display: flex;
    align-items: center;
}

.uk-btn-group.gap-1 > .text-lg {
    flex-grow: 1;
}

html .menu-logo {
    background: url('/common/img/logo-icon-dark.svg') no-repeat center center;
    background-size: contain;
}

html:not(.dark) .menu-logo {
    background: url('/common/img/logo-icon-light.svg') no-repeat center center;
    background-size: contain;
}

.text-destructive {
    color: hsl(var(--destructive) / var(--destructive-alpha, 1));
}

.text-secondary {
    color: hsl(var(--secondary));
}

.bg-foreground {
    background-color: hsl(var(--foreground));
}

.bg-secondary {
    background-color: hsl(var(--secondary));
}

.border-input {
    border-color: hsl(var(--secondary));
}

.uk-badge {
    min-width: 1.7rem;
    min-height: 1.7rem;
    line-height: 1;
}

.ql-container {
    height: fit-content;
    min-height: 200px;
    max-height: 800px;
    overflow-y: auto;
}
.ql-editor.ql-blank {
    min-height: 200px;
}

.ql-editor[data-placeholder]::before {
    color: hsl(var(--foreground));
}

.quill :is(p:has(>br), p:has(>br) + ol) {
    margin-bottom: 0;
}
 
.quill :is(h2, h3, h4, p):has(+ol) {
    margin-bottom: 12px;
}

.quill h2,
.quill h3,
.quill h4 {
    font-weight: 400;
}

.quill h2 {
    font-size: 22px;
    line-height: 30px;
    margin-bottom: 8px;
}

.quill h3 {
    font-size: 20px;
    line-height: 28px;
    margin-bottom: 4px;
}

.quill h4 {
    font-size: 18px;
    line-height: 24px;
    margin-bottom: 4px;
}

.quill p {
    font-size: 16px;
    line-height: 24px;
    margin-bottom: 8px;
    color: #b3b3b3;
    color: light-dark(#616161, #b3b3b3);
}

.quill code {
    background-color: light-dark(#d5d5d5, #454545);
    padding: 4px 8px;
    border-radius: 4px;
}

.quill code strong{
    font-family: inherit;
    font-weight: 700;
}

.quill ol:has(li[data-list="ordered"]),
.quill ol:has(li[data-list="bullet"]) {
    padding-left: 24px;
}
.quill ol li:not(:last-child) {
    margin-bottom: 8px;
}

.quill ol:has(li[data-list="ordered"]) {
    list-style: decimal;
}

.quill ol:has(li[data-list="bullet"]) {
    list-style: disc;
}

.quill a:not(.uk-btn) {
    color: var(--color-indigo-500);
}

.quill blockquote {
    background-color: hsl(var(--secondary));
    border-left: 4px solid hsl(var(--foreground));
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 20px;
    margin: 12px 0;
}

.quill .ql-code-block-container {
    font-size: 16px;
    line-height: 24px;
    padding: 12px 16px;
    background-color: hsl(var(--secondary));
    white-space: pre-wrap;
    border-radius: 8px;
    margin: 12px 0;
}

.ql-snow .ql-editor code {
    color: hsl(var(--secondary));
}

.uk-btn-group>.uk-btn:last-child,.uk-btn-group>.uk-inline:last-child>.uk-btn {
    border-top-right-radius: var(--uk-btn-radius) !important;
    border-bottom-right-radius: var(--uk-btn-radius) !important;
}

/* ========== PAGE TABS (Flowbite underline + SnowUI) ========== */

.page-tabs-container {
    border-bottom: 1px solid hsl(var(--border) / var(--border-alpha, 0.15));
    margin-bottom: 16px;
}

.page-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    list-style: none;
    margin: 0 0 -1px 0;
    padding: 0;
}

.page-tabs li {
    margin: 0 4px;
}

.page-tab.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 4px 4px 0 0;
    background: none;
    transition: color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.page-tab.nav-link:hover {
    color: hsl(var(--primary));
    border-bottom-color: hsl(var(--primary) / 0.4);
}

.page-tab.nav-link.active {
    color: hsl(var(--primary));
    border-bottom-color: hsl(var(--primary));
    background: none;
}

.page-tab uk-icon {
    flex-shrink: 0;
}

/* ========== COMPACT ACTION TOOLBAR ========== */

.action-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.action-toolbar .dropdown {
    position: relative;
}

.action-toolbar .action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: transparent;
    border: 1px solid var(--border-subtle, #404040);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-primary, #F0F0F0);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.15s ease;
    white-space: nowrap;
    line-height: 1.4;
    min-height: 34px;
}

.action-toolbar .action-btn:hover {
    border-color: var(--border-medium, #50506E);
    background: var(--bg-active, rgba(255, 255, 255, 0.04));
}

.action-toolbar .action-btn:focus,
.action-toolbar .action-btn[aria-expanded="true"] {
    border-color: var(--accent-brand, #6D28D9);
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.15);
}

.action-toolbar .action-btn uk-icon {
    flex-shrink: 0;
    color: var(--text-secondary, #B0B0B0);
    transition: color 0.15s ease;
}

.action-toolbar .action-btn:hover uk-icon {
    color: var(--text-primary, #F0F0F0);
}

.action-toolbar .action-btn[aria-expanded="true"] uk-icon {
    color: var(--accent-brand, #6D28D9);
}

.action-toolbar .action-btn .action-btn-chevron {
    color: var(--text-secondary, #B0B0B0);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 2px;
}

.action-toolbar .action-btn[aria-expanded="true"] .action-btn-chevron {
    transform: rotate(180deg);
}

.action-toolbar .action-btn-primary {
    background: var(--accent-brand, #6D28D9);
    border-color: var(--accent-brand, #6D28D9);
    color: #FFFFFF;
}

.action-toolbar .action-btn-primary:hover {
    background: var(--accent-brand-hover, #5B21B6);
    border-color: var(--accent-brand-hover, #5B21B6);
}

.action-toolbar .action-btn-primary uk-icon {
    color: #FFFFFF;
}

.action-toolbar .action-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 50;
    background: var(--bg-secondary, #2B2B2B);
    border: 1px solid var(--border-subtle, #404040);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 4px;
    min-width: 100%;
    max-width: 280px;
}

.action-toolbar .action-dropdown.psui-open {
    display: block;
    animation: actionDropdownFadeIn 0.15s ease-out;
}

@keyframes actionDropdownFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.action-toolbar .action-dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 0.8125rem;
    color: var(--text-primary, #F0F0F0);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    text-align: left;
    font-family: inherit;
    line-height: 1.4;
    margin: 1px 0;
}

.action-toolbar .action-dropdown-item:hover {
    background: var(--bg-active, #333333);
    color: var(--text-primary, #F0F0F0);
    text-decoration: none;
}

html:not(.dark) .action-toolbar .action-btn {
    border-color: #E2E8F0;
    color: #374151;
}

html:not(.dark) .action-toolbar .action-btn:hover {
    border-color: #CBD5E1;
    background: rgba(0, 0, 0, 0.02);
}

html:not(.dark) .action-toolbar .action-btn uk-icon {
    color: #6B7280;
}

html:not(.dark) .action-toolbar .action-btn:hover uk-icon {
    color: #374151;
}

html:not(.dark) .action-toolbar .action-dropdown {
    background: #FFFFFF;
    border-color: #E2E8F0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

html:not(.dark) .action-toolbar .action-dropdown-item {
    color: #374151;
}

html:not(.dark) .action-toolbar .action-dropdown-item:hover {
    background: #F3F4F6;
    color: #111827;
}


/* ========== REMOTE BANK CARDS (rbc-*) ========== */

.rbc-card {
    border: 1px solid var(--border-subtle, #404040);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.rbc-card:hover {
    border-color: var(--border-medium, #50506E);
}

.rbc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-secondary, #252525);
    border-bottom: 1px solid var(--border-subtle, #404040);
}

.rbc-bank-name {
    font-weight: 600;
    font-size: 0.875rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rbc-body {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rbc-suggestion {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
}

.rbc-suggestion-name {
    font-size: 0.8125rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rbc-manual {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle, #404040);
    margin-top: 4px;
    flex-wrap: wrap;
}

.rbc-manual .uk-select {
    flex: 1;
    min-width: 180px;
    max-width: 300px;
    font-size: 0.8125rem;
    height: 30px;
    padding: 0 8px;
}

html:not(.dark) .rbc-card {
    border-color: #e5e7eb;
}

html:not(.dark) .rbc-card:hover {
    border-color: #d1d5db;
}

html:not(.dark) .rbc-header {
    background: #f9fafb;
    border-bottom-color: #e5e7eb;
}

html:not(.dark) .rbc-manual {
    border-top-color: #e5e7eb;
}
