/* Shared compact field controls — full 4-side border, connected dropdown+input */

.fin-input-wrapper {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    box-sizing: border-box;
    background: #fafafa;
    border: 1px solid #d4d4d8;
    border-radius: 0.75rem;
    padding: 0 0.625rem;
    height: 36px;
    min-height: 36px;
    min-width: 0;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.fin-input-wrapper.w-full,
.fin-input-wrapper.flex-1 {
    display: flex;
    width: 100%;
}

.fin-input-wrapper.flex-1 {
    flex: 1 1 0%;
    width: auto;
}

.dark .fin-input-wrapper,
html.dark .fin-input-wrapper {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.fin-input-wrapper:focus-within {
    background: #ffffff;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.dark .fin-input-wrapper:focus-within,
html.dark .fin-input-wrapper:focus-within {
    background: rgba(24, 24, 27, 0.95);
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.fin-input-wrapper--on-dark {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.fin-input-wrapper--on-dark:focus-within {
    background: rgba(24, 24, 27, 0.95);
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.fin-input-field {
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.825rem;
    font-weight: 700;
    color: inherit;
    width: 100%;
    min-width: 0;
    text-align: right;
    padding: 0;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    box-shadow: none;
}

.fin-input-field::-webkit-inner-spin-button,
.fin-input-field::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fin-solid-input {
    box-sizing: border-box;
    width: 100%;
    height: 36px;
    min-height: 36px;
    background: #fafafa;
    border: 1px solid #d4d4d8;
    border-radius: 0.75rem;
    padding: 0 0.75rem;
    font-size: 0.825rem;
    font-weight: 700;
    color: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dark .fin-solid-input,
html.dark .fin-solid-input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
}

.fin-solid-input:focus {
    background: #ffffff;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.dark .fin-solid-input:focus,
html.dark .fin-solid-input:focus {
    background: rgba(24, 24, 27, 0.95);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.fin-pill-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-sizing: border-box;
    background: #fafafa;
    border: 1px solid #d4d4d8;
    border-radius: 0.75rem;
    padding: 0 1.5rem 0 0.75rem;
    height: 36px;
    min-height: 36px;
    font-size: 0.75rem;
    font-weight: 700;
    color: inherit;
    outline: none;
    cursor: pointer;
    line-height: 1;
    max-width: 100%;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.fin-pill-select::-ms-expand {
    display: none;
}

.dark .fin-pill-select,
html.dark .fin-pill-select {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
}

.fin-pill-select:hover {
    background: rgba(228, 228, 231, 0.9);
}

.dark .fin-pill-select:hover,
html.dark .fin-pill-select:hover {
    background: rgba(255, 255, 255, 0.12);
}

.fin-pill-select:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.fin-pill-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.fin-pill-select-wrap.w-full {
    display: flex;
    width: 100%;
}

.fin-pill-select.w-full {
    width: 100%;
    box-sizing: border-box;
}

.fin-pill-select-wrap > i {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 8px;
    color: #a1a1aa;
}

.fin-date-picker {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    background: #fafafa;
    border: 1px solid #d4d4d8;
    border-radius: 0.75rem;
    padding: 0 0.65rem;
    height: 36px;
    min-height: 36px;
    font-size: 0.75rem;
    font-weight: 700;
    color: inherit;
    outline: none;
    cursor: pointer;
    max-width: 100%;
}

.dark .fin-date-picker,
html.dark .fin-date-picker {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
}

.fin-date-picker:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.fin-combo {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 40px;
    background: #fafafa;
    border: 1px solid #d4d4d8;
    border-radius: 0.75rem;
    overflow: visible;
}

.dark .fin-combo,
html.dark .fin-combo {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
}

.fin-combo:focus-within {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
    background: #ffffff;
}

.dark .fin-combo:focus-within,
html.dark .fin-combo:focus-within {
    background: rgba(24, 24, 27, 0.95);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.fin-combo-type {
    position: relative;
    flex: 0 1 auto;
    display: flex;
    align-items: stretch;
    border-right: 1px solid #d4d4d8;
    min-width: 0;
    max-width: 58%;
}

.dark .fin-combo-type,
html.dark .fin-combo-type {
    border-right-color: rgba(255, 255, 255, 0.12);
}

.fin-combo-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    height: 100%;
    border: none;
    background: transparent;
    padding: 0 1.55rem 0 0.8rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: inherit;
    cursor: pointer;
    outline: none;
    min-width: 0;
    box-shadow: none;
}

.fin-combo-type > i {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 8px;
    color: #a1a1aa;
}

.fin-combo-amount {
    flex: 1 1 0%;
    width: auto;
    min-width: 0;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 0.625rem !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden;
}

.fin-combo-amount input,
.fin-combo-amount .fin-input-field,
.fin-combo-amount .sb-input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    width: 100%;
    min-width: 0;
    height: 100%;
    font-size: 0.825rem;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
    padding: 0 !important;
}

.fin-hero-field {
    box-sizing: border-box;
    background: #fafafa;
    border: 1px solid #d4d4d8;
}

.dark .fin-hero-field,
html.dark .fin-hero-field {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
}

.fin-solid-input.w-16 {
    width: 4rem;
}

.fin-solid-input.w-24 {
    width: 6rem;
}

.fin-pill-select--inset {
    height: 28px;
    min-height: 28px;
    border: none;
    background: transparent;
    padding-left: 0.35rem;
}

.fin-pill-select--inset:hover,
.dark .fin-pill-select--inset,
html.dark .fin-pill-select--inset,
.fin-pill-select--inset:focus {
    background: transparent;
    box-shadow: none;
    border: none;
}

.dark .fin-hero-field:focus-within,
html.dark .fin-hero-field:focus-within {
    background: rgba(24, 24, 27, 0.95);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

/* Custom premium dropdown (replaces native select chrome) */
.fin-dd {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    max-width: min(100%, 240px);
    vertical-align: middle;
}

.fin-dd.is-full {
    display: flex;
    width: 100%;
    max-width: 100%;
}

.fin-dd > select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.fin-dd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    width: 100%;
    height: 36px;
    min-height: 36px;
    padding: 0 0.65rem 0 0.85rem;
    background: #ffffff;
    border: 1px solid #d4d4d8;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #18181b;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dark .fin-dd-btn,
html.dark .fin-dd-btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
    color: #f8fafc;
    box-shadow: none;
}

.fin-dd-btn:hover {
    background: #fafafa;
    border-color: #a1a1aa;
}

.dark .fin-dd-btn:hover,
html.dark .fin-dd-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.fin-dd.is-open .fin-dd-btn,
.fin-dd-btn:focus-visible {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
    background: #ffffff;
}

.dark .fin-dd.is-open .fin-dd-btn,
html.dark .fin-dd.is-open .fin-dd-btn,
.dark .fin-dd-btn:focus-visible,
html.dark .fin-dd-btn:focus-visible {
    background: rgba(24, 24, 27, 0.95);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.fin-dd-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fin-dd-btn > i {
    font-size: 9px;
    color: #71717a;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.fin-dd.is-open .fin-dd-btn > i {
    transform: rotate(180deg);
    color: #10b981;
}

.fin-dd-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 60;
    min-width: 100%;
    width: max(100%, 228px);
    max-width: min(100vw - 2rem, 360px);
    max-height: min(320px, 70vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.35rem;
    border-radius: 0.9rem;
    background: #ffffff;
    border: 1px solid #e4e4e7;
    box-shadow: 0 18px 40px -16px rgba(15, 23, 42, 0.35);
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.fin-dd-search {
    display: block;
    width: 100%;
    margin: 0 0 0.3rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid #e4e4e7;
    border-radius: 0.65rem;
    background: #fafafa;
    font-size: 0.75rem;
    font-weight: 600;
    color: #18181b;
    outline: none;
}

.fin-dd-search:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
    background: #fff;
}

.dark .fin-dd-search,
html.dark .fin-dd-search {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.14);
    color: #f8fafc;
}

.fin-dd.is-full .fin-dd-menu {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
}

@media (max-width: 640px) {
    .fin-dd-menu {
        max-width: calc(100vw - 2rem);
    }
}

.dark .fin-dd-menu,
html.dark .fin-dd-menu {
    background: #18181b;
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.7);
}

.fin-dd-menu.hidden {
    display: none !important;
}

.fin-dd-option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.5rem 0.55rem;
    border: none;
    border-radius: 0.65rem;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: inherit;
}

.fin-dd-option:hover,
.fin-dd-option.is-active {
    background: #f4f4f5;
}

.dark .fin-dd-option:hover,
.dark .fin-dd-option.is-active,
html.dark .fin-dd-option:hover,
html.dark .fin-dd-option.is-active {
    background: rgba(255, 255, 255, 0.08);
}

.fin-dd-option-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.fin-dd-option-title {
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.25;
    color: #18181b;
}

.dark .fin-dd-option-title,
html.dark .fin-dd-option-title {
    color: #f8fafc;
}

.fin-dd-option-sub {
    font-size: 0.62rem;
    font-weight: 600;
    color: #71717a;
    line-height: 1.3;
    margin-top: 1px;
}

.fin-dd-option-check {
    font-size: 0.7rem;
    color: #10b981;
    opacity: 0;
    flex-shrink: 0;
}

.fin-dd-option.is-active .fin-dd-option-check {
    opacity: 1;
}

.fin-combo-type .fin-dd {
    display: flex;
    height: 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex-shrink: 1;
}

.fin-combo-type .fin-dd-btn {
    height: 100%;
    width: 100%;
    min-width: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding-left: 0.8rem;
}

.fin-combo-type .fin-dd-btn:hover,
.fin-combo.is-open .fin-dd-btn,
.fin-combo-type .fin-dd.is-open .fin-dd-btn,
.fin-combo-type .fin-dd-btn:focus-visible {
    background: transparent;
    box-shadow: none;
    border: none;
}

.fin-combo-type .fin-dd-menu {
    left: 0;
    right: auto;
}

/* ==========================================================================
   Standardized Action Toolbar, Buttons & Export Popovers
   ========================================================================== */

.fin-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.65rem;
    border: 1px solid #e4e4e7;
    background: #ffffff;
    color: #18181b;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    cursor: pointer;
    text-decoration: none;
    line-height: 1.25;
}

.dark .fin-action-btn,
html.dark .fin-action-btn {
    background: #18181b;
    border-color: rgba(255, 255, 255, 0.12);
    color: #f4f4f5;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
}

.fin-action-btn:hover {
    border-color: #10b981;
    color: #10b981;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dark .fin-action-btn:hover,
html.dark .fin-action-btn:hover {
    border-color: #10b981;
    color: #34d399;
}

.fin-action-btn:active {
    transform: translateY(0);
}

.fin-action-btn-primary {
    background: #059669 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3) !important;
}

.fin-action-btn-primary:hover {
    background: #047857 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.4) !important;
}

/* Export Dropdown Menu */
#export-dropdown,
.fin-export-dropdown {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 14px 35px -4px rgba(0, 0, 0, 0.18), 0 4px 12px -2px rgba(0, 0, 0, 0.08) !important;
    z-index: 100 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.dark #export-dropdown,
html.dark #export-dropdown,
.dark .fin-export-dropdown,
html.dark .fin-export-dropdown {
    background-color: #18181b !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 14px 35px -4px rgba(0, 0, 0, 0.6) !important;
}

/* Dropdown Menu Item */
.fin-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.65rem;
    border-radius: 0.75rem;
    background: transparent;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    outline: none;
    color: inherit;
    font-family: inherit;
}

.fin-dropdown-item:hover {
    background: #f1f5f9 !important;
}

.dark .fin-dropdown-item:hover,
html.dark .fin-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}
