/* OrgSwitcher — compact header select, strips form-field chrome */

/* Features page checkboxes — use Filament primary-500 (oklch format) */
.fi-features-checkbox {
    color: var(--primary-500);
    accent-color: var(--primary-500);
}
.fi-features-checkbox:checked {
    background-color: var(--primary-500) !important;
    border-color: var(--primary-500) !important;
}
.fi-features-checkbox:focus {
    outline-color: var(--primary-500);
}

/* Features page — 2-column card grid */
.fi-features-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 40rem) {
    .fi-features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.fi-features-checkbox {
    flex-shrink: 0;
    margin-top: 0.125rem;
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.fi-features-card {
    display: flex;
    align-items: flex-start;
    column-gap: 0.75rem;
    border-radius: 0.75rem;
    background-color: #fff;
    padding: 1rem;
    cursor: pointer;
}

.dark .fi-features-card {
    background-color: rgb(17 24 39);
}

.fi-features-card-body {
    display: grid;
    row-gap: 0.25rem;
}

.fi-features-card-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(3 7 18);
    line-height: 1.25rem;
}

.dark .fi-features-card-name {
    color: #fff;
}

.fi-features-card-desc {
    font-size: 0.75rem;
    color: rgb(107 114 128);
    line-height: 1rem;
}

.dark .fi-features-card-desc {
    color: rgb(156 163 175);
}

.fi-features-card--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fi-features-card-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.fi-features-actions {
    display: flex;
    justify-content: flex-end;
}

/* ── Custom Style page ── */

.fi-cs-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.fi-cs-controls {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fi-cs-preview-col {
    display: flex;
    width: 380px;
    flex-shrink: 0;
    flex-direction: column;
    gap: 0;
    position: sticky;
    top: 0;
    height: calc(100vh - 6rem);
    align-self: flex-start;
}

.fi-cs-browser-chrome {
    border-radius: 0.75rem 0.75rem 0 0;
    background-color: rgb(243 244 246);
    border: 1px solid rgb(229 231 235);
    border-bottom: none;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dark .fi-cs-browser-chrome {
    background-color: rgb(31 41 55);
    border-color: rgb(55 65 81);
}

.fi-cs-browser-dots {
    display: flex;
    gap: 0.25rem;
}
.fi-cs-browser-dots span {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 9999px;
}

.fi-cs-browser-url {
    flex: 1;
    font-size: 0.6875rem;
    font-family: monospace;
    text-align: center;
    color: rgb(156 163 175);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}


.fi-cs-iframe-wrap {
    flex: 1;
    border: 1px solid rgb(229 231 235);
    border-top: none;
    border-radius: 0 0 0.75rem 0.75rem;
    overflow: hidden;
}
.dark .fi-cs-iframe-wrap {
    border-color: rgb(55 65 81);
}

.fi-cs-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Theme preset select row */
.fi-cs-theme-select-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fi-cs-theme-wrapper {
    flex: 1 1 0;
    min-width: 0;
}

.fi-cs-theme-dots {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.fi-cs-theme-dots-inner {
    display: flex;
    align-items: center;
    gap: 0;
}

.fi-cs-theme-dot {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 9999px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
    display: inline-block;
}
.fi-cs-theme-dot + .fi-cs-theme-dot {
    margin-inline-start: -0.25rem;
}

/* Color picker grid */
.fi-cs-color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
}
@media (min-width: 48rem) {
    .fi-cs-color-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.fi-cs-color-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.fi-cs-color-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgb(107 114 128);
}
.dark .fi-cs-color-label {
    color: rgb(156 163 175);
}

.fi-cs-color-input-row {
    display: flex;
    align-items: center;
    gap: 0;
}

/* Monospace font for hex color inputs */
.fi-cs-hex-wrapper .fi-input {
    font-family: ui-monospace, monospace;
    font-size: 0.8125rem;
}

/* Hex wrapper — fills remaining width, removes left radius to join with swatch */
.fi-cs-hex-wrapper {
    flex: 1 1 0;
    min-width: 0;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-start-start-radius: 0 !important;
    border-end-start-radius: 0 !important;
}

/* Swatch — overlays the native color input */
.fi-cs-swatch-wrap {
    position: relative;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.375rem 0 0 0.375rem;
    overflow: hidden;
    border: 1px solid rgb(209 213 219);
    border-right: none;
}
.dark .fi-cs-swatch-wrap {
    border-color: rgb(75 85 99);
}

.fi-cs-swatch {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.fi-cs-color-native {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* Font size row */
.fi-cs-range-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.fi-cs-range-row input[type=range] {
    flex: 1;
    accent-color: var(--color-primary-500, #f59e0b);
}
.fi-cs-range-val {
    width: 1.75rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(55 65 81);
}
.dark .fi-cs-range-val {
    color: rgb(209 213 219);
}

/* Typography / Buttons grid */
.fi-cs-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.fi-cs-field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgb(107 114 128);
    margin-bottom: 0.375rem;
}
.dark .fi-cs-field-label {
    color: rgb(156 163 175);
}

/* Radio group */
.fi-cs-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.fi-cs-radio-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: rgb(55 65 81);
}
.dark .fi-cs-radio-label {
    color: rgb(209 213 219);
}
.fi-cs-radio-label input[type=radio] {
    accent-color: var(--primary-500);
    cursor: pointer;
    width: 1rem;
    height: 1rem;
}
.fi-cs-radio-label input[type=radio]:focus {
    outline-color: var(--primary-500);
}

/* ── Dark Mode Toggle ── */
.fi-cs-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.fi-cs-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.fi-cs-toggle-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(3 7 18);
}
.dark .fi-cs-toggle-label {
    color: #fff;
}
.fi-cs-toggle-desc {
    font-size: 0.75rem;
    color: rgb(107 114 128);
}
.dark .fi-cs-toggle-desc {
    color: rgb(156 163 175);
}
.fi-cs-toggle-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    cursor: pointer;
    line-height: 0;
}
.fi-cs-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.fi-cs-toggle-track {
    display: block;
    width: 2.75rem;
    height: 1.5rem;
    border-radius: 9999px;
    background: rgb(209 213 219);
    position: relative;
    transition: background 0.2s;
}
.dark .fi-cs-toggle-track {
    background: rgb(75 85 99);
}
.fi-cs-toggle-track::after {
    content: '';
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.fi-cs-toggle-input:checked ~ .fi-cs-toggle-track {
    background: rgb(99 102 241);
}
.fi-cs-toggle-input:checked ~ .fi-cs-toggle-track::after {
    transform: translateX(1.25rem);
}
.fi-cs-toggle-wrap:focus-within .fi-cs-toggle-track {
    outline: 2px solid rgb(99 102 241);
    outline-offset: 2px;
}
.fi-cs-dark-mode-hint {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.625rem;
    font-size: 0.75rem;
    color: rgb(180 83 9);
}
.dark .fi-cs-dark-mode-hint {
    color: rgb(251 191 36);
}

/* Save actions row */
.fi-cs-actions {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 1.5rem;
}

/* ── Mock payment page preview ── */
.fi-cs-mock {
    flex: 1;
    overflow-y: auto;
    border: 1px solid rgb(229 231 235);
    border-top: none;
    border-radius: 0 0 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
}
.dark .fi-cs-mock {
    border-color: rgb(55 65 81);
}

/* Old header — hidden, replaced by hero layout */
.fi-cs-mock-header { display: none; }

/* ─── Mock hero section ─── */
.fi-cs-mock-hero {
    position: relative;
    height: 56px;
    overflow: hidden;
}
.fi-cs-mock-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.06) 0%, rgba(0,0,0,0.28) 100%);
}
.fi-cs-mock-lang {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 8px;
    color: rgba(255,255,255,0.85);
    background: rgba(0,0,0,0.28);
    padding: 2px 5px;
    border-radius: 99px;
}

/* ─── Mock stack (logo card + content) ─── */
.fi-cs-mock-stack {
    position: relative;
}
.fi-cs-mock-logo-wrap {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
    margin-top: -18px;
}
.fi-cs-mock-logo-card {
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}
.fi-cs-mock-content {
    border-radius: 14px 14px 0 0;
    padding: 14px 16px 20px;
    margin-top: -10px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.fi-cs-mock-org-name {
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 4px;
}

/* Legacy body — kept for safety but no longer rendered */
.fi-cs-mock-body {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}
.fi-cs-mock-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.fi-cs-mock-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(128,128,128,0.25);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875em;
}
.fi-cs-mock-flag {
    font-size: 0.8125em;
    white-space: nowrap;
}
.fi-cs-mock-placeholder {
    opacity: 0.4;
    font-size: 0.875em;
}
.fi-cs-mock-card {
    border: 1px solid rgba(128,128,128,0.2);
    border-radius: var(--mock-radius, 0.5rem);
    padding: 12px 14px;
}
.fi-cs-mock-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125em;
}
.fi-cs-mock-invoice-num {
    font-size: 10px;
    font-weight: 600;
}
.fi-cs-mock-invoice-date {
    font-size: 9px;
    opacity: 0.6;
}
.fi-cs-mock-amount {
    font-weight: 700;
    font-size: 1em;
}
.fi-cs-mock-tips {
    display: flex;
    gap: 0.5rem;
}
.fi-cs-mock-tip-btn {
    flex: 1;
    padding: 0.5rem 0.375rem;
    border: 1px solid;
    font-size: 0.8125em;
    font-weight: 600;
    background: transparent;
    cursor: default;
    text-align: center;
}
.fi-cs-mock-pay-btn {
    width: 100%;
    padding: 0.875rem;
    color: #fff;
    font-weight: 700;
    font-size: 0.9375em;
    border: none;
    cursor: default;
}
.fi-cs-mock-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75em;
    opacity: 0.7;
}
.fi-cs-mock-links a {
    text-decoration: underline;
    cursor: pointer;
}
.fi-cs-mock-footer {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.6875em;
    opacity: 0.4;
    border-top: 1px solid rgba(128,128,128,0.2);
}

.org-switcher {
    & .fi-fo-field-wrp {
        gap: 0;
    }

    & .fi-fo-field-content-col {
        padding-top: 0;
        padding-bottom: 0;
    }

    & .fi-input-wrp {
        border-radius: 0.5rem;
        min-height: 2.25rem;
        box-shadow: none;

        &:not(.fi-disabled):not(:has(.fi-ac-action:focus)) {
            &:focus-within {
                --tw-ring-color: rgb(156 163 175 / 0.5) !important;
                --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 2px var(--tw-ring-color) !important;
            }
        }
    }

    & .fi-select-input-btn {
        min-height: 2.25rem;
        padding-top: 0.375rem;
        padding-bottom: 0.375rem;
        font-size: 0.875rem;
    }

    & .fi-select-input-placeholder {
        opacity: 0.65;
    }
}

/* ── QR Code Modal ── */

.fi-qr-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 0.25rem 0 0.5rem;
}

.fi-qr-card {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 2px 16px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fi-qr-img {
    position: relative;
    width: 220px;
    height: 220px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fi-qr-img svg,
.fi-qr-img-content {
    width: 220px;
    height: 220px;
    display: block;
}

.fi-qr-overlay {
    pointer-events: none;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fi-qr-overlay-text {
    background: rgba(255,255,255,0.92);
    border-radius: 0.25rem;
    padding: 0.125rem 0.375rem;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    color: rgb(31 41 55);
    max-width: 60px;
    text-align: center;
    word-break: break-all;
}

.fi-qr-meta {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.fi-qr-location {
    font-size: 1rem;
    font-weight: 600;
    color: rgb(17 24 39);
    margin: 0;
    line-height: 1.375;
}
.dark .fi-qr-location {
    color: rgb(249 250 251);
}

.fi-qr-org {
    font-size: 0.8125rem;
    color: rgb(107 114 128);
    margin: 0;
    line-height: 1.4;
}
.dark .fi-qr-org {
    color: rgb(156 163 175);
}

.fi-qr-url-box {
    width: 100%;
    background: rgb(249 250 251);
    border: 1px solid rgb(229 231 235);
    border-radius: 0.625rem;
    padding: 0.625rem 0.875rem;
}
.dark .fi-qr-url-box {
    background: rgb(17 24 39);
    border-color: rgb(55 65 81);
}

.fi-qr-url-text {
    display: block;
    font-family: ui-monospace, monospace;
    font-size: 0.6875rem;
    color: rgb(107 114 128);
    word-break: break-all;
    line-height: 1.5;
    user-select: all;
}
.dark .fi-qr-url-text {
    color: rgb(156 163 175);
}

.fi-qr-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* ── Custom QR page ── */
.fi-qr-color-grid {
    grid-template-columns: 1fr 1fr !important;
}

.fi-qr-preview-mock {
    flex: 1;
    overflow-y: auto;
    border: 1px solid rgb(229 231 235);
    border-top: none;
    border-radius: 0 0 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    position: relative;
    background: rgb(249 250 251);
}
.dark .fi-qr-preview-mock {
    background: rgb(17 24 39);
    border-color: rgb(55 65 81);
}

.fi-qr-preview-text {
    margin: 0;
    text-align: center;
    max-width: 240px;
    line-height: 1.4;
    word-break: break-word;
}

.fi-qr-preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 0.75rem 0.75rem;
    background: rgba(249,250,251,0.75);
}
.dark .fi-qr-preview-loading {
    background: rgba(17,24,39,0.75);
}

.fi-qr-preview-spinner {
    width: 1.5rem;
    height: 1.5rem;
}

/* Logo remove button */
.fi-qr-logo-actions {
    margin-top: 0.75rem;
}

/* Logo upload hint */
.fi-qr-page-hint {
    font-size: 0.8125rem;
    color: rgb(107 114 128);
    margin: 0 0 0.75rem;
}
.dark .fi-qr-page-hint {
    color: rgb(156 163 175);
}

.fi-qr-logo-current {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.fi-qr-logo-thumb {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
    border-radius: 0.375rem;
    border: 1px solid rgb(229 231 235);
    background: #fff;
    padding: 0.125rem;
}
.dark .fi-qr-logo-thumb {
    border-color: rgb(55 65 81);
    background: rgb(31 41 55);
}

.fi-qr-upload-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fi-qr-upload-loading {
    display: flex;
    align-items: center;
}

.fi-qr-error {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
    color: rgb(220 38 38);
}
.dark .fi-qr-error {
    color: rgb(248 113 113);
}

/* Text block rows */
.fi-qr-blocks {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fi-qr-tb-row {
    border: 1px solid rgb(229 231 235);
    border-radius: 0.75rem;
    padding: 1rem;
}
.dark .fi-qr-tb-row {
    border-color: rgb(55 65 81);
}

.fi-qr-tb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.fi-qr-tb-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(17 24 39);
}
.dark .fi-qr-tb-label {
    color: rgb(249 250 251);
}

.fi-qr-tb-preview {
    font-size: 1.25rem;
    font-weight: 500;
    transition: color 0.15s;
}

.fi-qr-tb-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.fi-qr-tb-field--full {
    grid-column: span 2;
}

.fi-qr-page-hint {
    font-size: 0.8125rem;
    color: rgb(107 114 128);
    margin: 0 0 0.75rem;
}
.dark .fi-qr-page-hint {
    color: rgb(156 163 175);
}

.fi-qr-color-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.fi-qr-color-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

/* Text block rows */
.fi-qr-blocks {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fi-qr-tb-row {
    border: 1px solid rgb(229 231 235);
    border-radius: 0.75rem;
    padding: 1rem;
}
.dark .fi-qr-tb-row {
    border-color: rgb(55 65 81);
}

.fi-qr-tb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.fi-qr-tb-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(17 24 39);
}
.dark .fi-qr-tb-label {
    color: rgb(249 250 251);
}

.fi-qr-tb-preview {
    font-size: 1.25rem;
    font-weight: 500;
    transition: color 0.15s, font-family 0.15s;
}

.fi-qr-tb-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.fi-qr-tb-field--full {
    grid-column: span 2;
}
