/* Shared Xentra entity form/view styling. Keep entity pages declarative by applying
   xentra-entity-* classes instead of repeating page-local CSS. */

:root {
    --xentra-primary: #4F46E5;
    --xentra-secondary: #06B6D4;
    --xentra-purple: #8B5CF6;
    --xentra-success: #22C55E;
    --xentra-warning: #F59E0B;
    --xentra-danger: #EF4444;
    --xentra-border: rgba(214,226,244,.86);
    --xentra-text: #0f172a;
    --xentra-muted: #64748b;
}

.xentra-entity-title,
.folderin-view-title {
    min-height: 76px;
    margin-bottom: 18px !important;
    padding: 18px 22px !important;
    border: 1px solid rgba(255,255,255,.58) !important;
    border-radius: 24px;
    color: #fff !important;
    background:
        radial-gradient(circle at 12% 18%, rgba(255,255,255,.32), transparent 25%),
        radial-gradient(circle at 82% 12%, rgba(6,182,212,.34), transparent 29%),
        linear-gradient(135deg, var(--xentra-primary) 0%, var(--xentra-purple) 52%, var(--xentra-secondary) 100%);
    box-shadow: 0 22px 54px rgba(79,70,229,.18);
    overflow: hidden;
    position: relative;
}

.xentra-entity-title::before,
.folderin-view-title::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.10) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.10) 1px, transparent 1px);
    background-size: 38px 38px;
    opacity: .36;
    pointer-events: none;
}

.xentra-entity-title > *,
.folderin-view-title > * {
    position: relative;
    z-index: 1;
}

.xentra-entity-title i,
.folderin-view-title i {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-end: 12px;
    color: #fff !important;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 14px 30px rgba(15,23,42,.14);
    backdrop-filter: blur(14px);
}

.xentra-entity-toolbar,
.folderin-view-toolbar {
    border: 1px solid rgba(214,226,244,.76) !important;
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.88), rgba(248,251,255,.78)),
        radial-gradient(circle at 12% 20%, rgba(79,70,229,.10), transparent 25%),
        radial-gradient(circle at 90% 14%, rgba(6,182,212,.12), transparent 28%) !important;
    box-shadow: 0 18px 42px rgba(15,23,42,.07) !important;
    backdrop-filter: blur(14px);
}

.xentra-entity-toolbar .card-body,
.folderin-view-toolbar .card-body {
    min-height: 68px;
}

.xentra-entity-toolbar .btn-icon,
.folderin-view-toolbar .btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px !important;
    border: 1px solid rgba(214,226,244,.72);
    background: rgba(255,255,255,.84);
    box-shadow: 0 10px 24px rgba(15,23,42,.07);
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.xentra-entity-toolbar .btn-icon:not(:disabled):hover,
.folderin-view-toolbar .btn-icon:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(15,23,42,.12);
    background: #fff;
}

.xentra-entity-toolbar .btn-icon:disabled,
.folderin-view-toolbar .btn-icon:disabled {
    opacity: .48;
    filter: grayscale(.25);
}

.xentra-entity-loading-card,
.folderin-loading-card {
    min-height: 360px;
    border: 1px solid rgba(214,226,244,.72);
    border-radius: 24px;
    background: rgba(255,255,255,.86);
    box-shadow: 0 20px 48px rgba(15,23,42,.08);
    backdrop-filter: blur(14px);
}

.xentra-entity-dialog,
.folderin-modern-dialog {
    --xentra-primary: #4F46E5;
    --xentra-secondary: #06B6D4;
    --xentra-purple: #8B5CF6;
    --xentra-success: #22C55E;
    --xentra-border: rgba(214,226,244,.86);
    --xentra-text: #0f172a;
}

.folderin-modern-dialog.modal-dialog {
    max-width: min(1180px, calc(100vw - 32px));
}

.xentra-entity-dialog .modal-content,
.folderin-modern-dialog .modal-content {
    border: 0 !important;
    border-radius: 28px !important;
    overflow: visible;
    max-height: calc(100vh - 48px);
    background: linear-gradient(180deg, rgba(248,251,255,.98), rgba(255,255,255,.96));
    box-shadow: 0 34px 90px rgba(15,23,42,.22) !important;
}

.xentra-entity-dialog .modal-header,
.folderin-modal-hero {
    position: relative;
    overflow: hidden;
    min-height: 58px;
    padding: 10px 18px !important;
    border: 0 !important;
    border-radius: 28px 28px 0 0;
    color: #fff;
    background:
        radial-gradient(circle at 14% 18%, rgba(255,255,255,.32), transparent 26%),
        radial-gradient(circle at 82% 12%, rgba(6,182,212,.38), transparent 30%),
        linear-gradient(135deg, var(--xentra-primary) 0%, var(--xentra-purple) 52%, var(--xentra-secondary) 100%);
}

.xentra-entity-dialog .modal-header.pb-0 {
    min-height: 72px;
    padding: 14px 18px !important;
    align-items: flex-start !important;
}

.xentra-entity-dialog .modal-header::before,
.folderin-modal-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.10) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.10) 1px, transparent 1px);
    background-size: 38px 38px;
    opacity: .44;
    pointer-events: none;
}

.xentra-entity-dialog .modal-header > *,
.folderin-modal-hero > * {
    position: relative;
    z-index: 1;
}

.xentra-entity-dialog .modal-header .modal-title,
.folderin-modal-hero h2 {
    color: #fff !important;
    font-size: 1.15rem;
    line-height: 1.25;
    margin-bottom: 4px !important;
}

.folderin-hero-icon {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 16px 34px rgba(15,23,42,.14);
    backdrop-filter: blur(14px);
}

.folderin-hero-icon i,
.folderin-hero-kicker i {
    color: #fff !important;
}

.folderin-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.22);
    color: rgba(255,255,255,.92);
    font-size: 11px;
    font-weight: 800;
}

.xentra-entity-dialog .mb-13.text-center {
    min-height: 64px;
    margin: -8px 0 22px !important;
    padding: 14px 18px;
    border: 1px solid rgba(214,226,244,.72);
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(79,70,229,.08), rgba(6,182,212,.10)),
        rgba(255,255,255,.78);
    box-shadow: 0 14px 34px rgba(15,23,42,.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.xentra-entity-dialog .mb-13.text-center h1 {
    margin: 0 !important;
    color: var(--xentra-text) !important;
    font-size: clamp(1.15rem, 1.6vw, 1.55rem);
    line-height: 1.45;
    font-weight: 900;
}

.xentra-entity-dialog .mb-13.text-center h1::before {
    content: "";
    width: 10px;
    height: 10px;
    margin-inline-end: 10px;
    border-radius: 999px;
    display: inline-block;
    vertical-align: middle;
    background: linear-gradient(135deg, var(--xentra-primary), var(--xentra-secondary));
    box-shadow: 0 0 0 6px rgba(79,70,229,.10);
}

.xentra-entity-dialog .btn-close,
.folderin-modern-close {
    width: 40px !important;
    height: 40px !important;
    border-radius: 14px !important;
    opacity: 1 !important;
    background-color: rgba(255,255,255,.90) !important;
    box-shadow: 0 12px 28px rgba(15,23,42,.18) !important;
}

.folderin-modern-close {
    min-width: 42px;
    border: 1px solid rgba(255,255,255,.72) !important;
    color: #4F46E5 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .18s ease, background-color .18s ease, color .18s ease;
}

.folderin-modern-close:hover {
    transform: translateY(-2px);
    background: #EF4444 !important;
    border-color: rgba(255,255,255,.88) !important;
    color: #fff !important;
}

.xentra-entity-dialog .modal-body,
.folderin-modern-body {
    max-height: calc(100vh - 148px);
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scroll-behavior: auto;
    overflow-anchor: none;
    padding: 22px 26px 0 !important;
    background:
        radial-gradient(circle at 18% 4%, rgba(79,70,229,.08), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 58%);
    border-radius: 0 0 28px 28px;
}

.xentra-entity-dialog form,
.xentra-entity-form-shell,
.folderin-modern-form-shell {
    border: 1px solid rgba(214,226,244,.72);
    border-radius: 24px;
    padding: 22px;
    background: rgba(255,255,255,.82);
    box-shadow: 0 18px 46px rgba(15,23,42,.08);
    backdrop-filter: blur(14px);
}

.xentra-entity-dialog .row.g-5,
.xentra-entity-form-shell .row.g-5,
.folderin-modern-form-shell .row.g-5 {
    --bs-gutter-x: 1.15rem;
    --bs-gutter-y: 1.1rem;
}

.xentra-entity-dialog h4,
.xentra-entity-form-shell h4,
.folderin-modern-form-shell h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 8px 0 4px !important;
    padding: 0 14px;
    border: 1px solid rgba(214,226,244,.76) !important;
    border-radius: 16px;
    color: var(--xentra-text) !important;
    background:
        linear-gradient(90deg, rgba(79,70,229,.10), rgba(6,182,212,.10)),
        rgba(255,255,255,.80);
    box-shadow: 0 10px 24px rgba(15,23,42,.04);
    font-size: 1rem;
}

.xentra-entity-dialog h4::before,
.xentra-entity-form-shell h4::before,
.folderin-modern-form-shell h4::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--xentra-primary), var(--xentra-secondary));
    box-shadow: 0 0 0 5px rgba(79,70,229,.10);
}

.xentra-entity-dialog .form-label,
.xentra-entity-dialog label:not(.form-check-label):not(.btn),
.xentra-entity-form-shell .form-label,
.folderin-modern-form-shell .form-label {
    color: #334155;
    font-size: 12px;
    margin-bottom: 7px;
    font-weight: 700;
}

.xentra-entity-dialog .form-control,
.xentra-entity-dialog .rz-dropdown,
.xentra-entity-dialog .rz-dropdown-trigger,
.xentra-entity-dialog .rz-inputtext,
.xentra-entity-form-shell .form-control,
.xentra-entity-form-shell .rz-dropdown,
.xentra-entity-form-shell .rz-dropdown-trigger,
.xentra-entity-form-shell .rz-inputtext,
.folderin-modern-form-shell .form-control,
.folderin-modern-form-shell .rz-dropdown,
.folderin-modern-form-shell .rz-dropdown-trigger,
.folderin-modern-form-shell .rz-inputtext {
    border-radius: 14px !important;
}

.xentra-entity-dialog .rz-dropdown,
.xentra-entity-form-shell .rz-dropdown,
.folderin-modern-form-shell .rz-dropdown {
    min-height: 46px;
    border-color: rgba(203,213,225,.96) !important;
    background: rgba(255,255,255,.92) !important;
    box-shadow: 0 8px 20px rgba(15,23,42,.04);
    display: flex !important;
    align-items: center !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    direction: rtl !important;
    text-align: right !important;
    position: relative !important;
}

.xentra-entity-dialog .rz-dropdown-trigger,
.xentra-entity-form-shell .rz-dropdown-trigger,
.folderin-modern-form-shell .rz-dropdown-trigger {
    height: 100% !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.xentra-entity-dialog .rz-dropdown-label,
.xentra-entity-dialog .rz-dropdown .rz-inputtext,
.xentra-entity-form-shell .rz-dropdown-label,
.xentra-entity-form-shell .rz-dropdown .rz-inputtext,
.folderin-modern-form-shell .rz-dropdown-label,
.folderin-modern-form-shell .rz-dropdown .rz-inputtext {
    position: absolute !important;
    inset-block: 0 !important;
    right: 10px !important;
    left: 48px !important;
    width: auto !important;
    max-width: none !important;
    min-height: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    line-height: 1.4 !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    direction: rtl !important;
    text-align: right !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.xentra-entity-dialog .rz-placeholder,
.xentra-entity-form-shell .rz-placeholder,
.folderin-modern-form-shell .rz-placeholder {
    color: #64748b !important;
    font-weight: 600 !important;
    text-align: right !important;
    line-height: 44px !important;
}

.xentra-entity-dialog .modal-footer,
.xentra-entity-dialog form > .d-flex.justify-content-start.mt-5,
.xentra-entity-actions,
.xentra-entity-dialog .folderin-modern-actions,
.folderin-modern-body .folderin-modern-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: 22px -26px 0;
    padding: 14px 26px !important;
    border-top: 1px solid rgba(214,226,244,.78);
    background: rgba(248,251,255,.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 -18px 42px rgba(15,23,42,.06);
}

.xentra-entity-dialog form > .d-flex.justify-content-start.mt-5 {
    justify-content: flex-start !important;
    gap: 12px;
    margin-top: 22px !important;
}

.xentra-entity-actions .btn,
.xentra-entity-dialog form > .d-flex.justify-content-start.mt-5 .btn,
.xentra-entity-dialog .folderin-modern-actions .btn,
.folderin-modern-body .folderin-modern-actions .btn {
    min-width: 116px;
    min-height: 42px;
    border-radius: 999px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.xentra-entity-dialog .btn-primary,
.xentra-entity-dialog form > .d-flex.justify-content-start.mt-5 .btn-success,
.xentra-entity-actions .btn-primary,
.folderin-modern-actions .btn-primary,
.xentra-entity-dialog .folderin-modern-actions .btn-success,
.folderin-modern-body .folderin-modern-actions .btn-success {
    border: 0;
    border-radius: 999px;
    padding-inline: 34px;
    background: linear-gradient(135deg, var(--xentra-primary), var(--xentra-secondary)) !important;
    box-shadow: 0 16px 30px rgba(79,70,229,.22);
}

.xentra-entity-dialog .btn-light,
.xentra-entity-actions .btn-light,
.xentra-entity-dialog .folderin-modern-actions .btn-light,
.folderin-modern-body .folderin-modern-actions .btn-light {
    border-radius: 999px;
    background: rgba(255,255,255,.82) !important;
    border: 1px solid rgba(226,232,240,.78) !important;
    color: #0f172a !important;
    box-shadow: 0 12px 26px rgba(15,23,42,.05);
}

.xentra-entity-dialog .modal-body .rz-dropdown-panel,
.folderin-modern-body .rz-dropdown-panel,
.rz-dropdown-panel {
    z-index: 1085 !important;
}

.rz-filter-popup,
.rz-filter-popup.rz-popup,
.rz-popup:has(.rz-grid-filter) {
    overflow: visible !important;
    z-index: 10550 !important;
}

.rz-popup:has(.rz-grid-filter) .rz-grid-filter {
    direction: rtl;
    overflow: visible !important;
}

.rz-popup:has(.rz-grid-filter) .rz-grid-filter .rz-dropdown,
.rz-popup:has(.rz-grid-filter) .rz-grid-filter .rz-textbox,
.rz-popup:has(.rz-grid-filter) .rz-grid-filter .rz-inputtext,
.rz-popup:has(.rz-grid-filter) .rz-grid-filter-label {
    direction: rtl;
    text-align: right;
    font-family: inherit;
}

.rz-popup:has(.rz-grid-filter) .rz-grid-filter-buttons {
    position: relative;
    z-index: 1;
}

.rz-filter-popup,
.rz-filter-popup .rz-popup,
.rz-filter-popup .rz-inputtext,
.rz-filter-popup .rz-button {
    direction: rtl;
    text-align: right;
    font-family: inherit;
}

.rz-filter-popup .rz-dropdown {
    direction: ltr;
    font-family: inherit;
}

.rz-filter-popup .rz-dropdown-label {
    direction: rtl;
    text-align: right;
    padding-right: 12px !important;
    padding-left: 30px !important;
}

.rz-filter-popup .rz-button {
    justify-content: center;
}

.rz-dropdown-panel {
    z-index: 20000 !important;
    min-width: 220px;
    max-height: 210px !important;
    overflow-y: auto !important;
    direction: rtl;
    text-align: right;
    font-family: inherit;
    background: #fff;
    border: 1px solid rgba(203,213,225,.92);
    border-radius: 12px;
    box-shadow: 0 18px 46px rgba(15,23,42,.16);
}

.rz-dropdown-panel .rz-dropdown-items,
.rz-dropdown-panel .rz-dropdown-item,
.rz-dropdown-panel .rz-dropdown-item span,
.rz-dropdown-panel .rz-multiselect-items {
    direction: rtl;
    text-align: right;
    font-family: inherit;
}

@media (max-width: 768px) {
    .folderin-modern-dialog.modal-dialog {
        max-width: calc(100vw - 16px);
        margin-inline: auto;
    }

    .xentra-entity-dialog .modal-body,
    .folderin-modern-body {
        padding: 18px 16px 0 !important;
    }

    .folderin-modal-hero {
        padding: 9px 12px !important;
    }

    .xentra-entity-dialog form,
    .xentra-entity-form-shell,
    .folderin-modern-form-shell {
        padding: 16px;
        border-radius: 20px;
    }

    .xentra-entity-actions,
    .xentra-entity-dialog .folderin-modern-actions,
    .folderin-modern-body .folderin-modern-actions {
        margin-inline: -14px;
        padding-inline: 14px !important;
    }
}
