:root {
    --pns-brand-start: #5f1fb2;
    --pns-brand-mid: #94148f;
    --pns-brand-end: #f47b12;
    --pns-brand-deep: #09075f;
    --pns-ink: #24324b;
    --pns-muted: #73829a;
    --pns-soft: #f6f7ff;
    --pns-soft-2: #fff9f4;
    --pns-border: rgba(144, 157, 186, 0.14);
    --pns-shadow: 0 12px 30px rgba(31, 45, 85, 0.05);
    --pns-radius: 20px;
}

body,
html {
    background:
        radial-gradient(circle at top right, rgba(244, 123, 18, 0.04), transparent 22%),
        radial-gradient(circle at top left, rgba(95, 31, 178, 0.05), transparent 24%),
        #f7f8fc;
    color: var(--pns-ink);
}

body.pns-app-shell {
    min-height: 100vh;
}

.layout-page {
    background: transparent;
}

.content-wrapper {
    background: transparent;
}

.container-p-y {
    padding-top: 1.2rem !important;
    padding-bottom: 1.2rem !important;
}

.container-xxl,
.container-xl,
.container-lg,
.container-md,
.container-sm,
.container {
    max-width: 1400px;
}

.card,
.modal-content,
.dropdown-menu,
.toast,
.select2-dropdown,
.swal2-popup {
    border: 1px solid var(--pns-border);
    border-radius: var(--pns-radius);
    box-shadow: var(--pns-shadow);
}

.card,
.modal-content,
.toast {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.card-body {
    padding: 1.4rem;
}

.card-header,
.card-footer {
    background: transparent;
    border-color: rgba(144, 157, 186, 0.16);
}

.card-title,
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--pns-ink);
    font-weight: 700;
}

.text-muted,
small,
.form-text {
    color: var(--pns-muted) !important;
}

.container-xxl > h4.fw-bold,
.content-wrapper h4.fw-bold:first-child,
.container-xxl h4.fw-bold:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    margin-bottom: 1.2rem !important;
    color: var(--pns-ink);
    font-size: 1.55rem;
}

.container-xxl > h4.fw-bold::before,
.content-wrapper h4.fw-bold:first-child::before,
.container-xxl h4.fw-bold:first-child::before {
    content: "";
    width: 10px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--pns-brand-start) 0%, var(--pns-brand-end) 100%);
    box-shadow: 0 8px 18px rgba(122, 22, 154, 0.16);
}

.container-xxl > h4.fw-bold .btn,
.content-wrapper h4.fw-bold:first-child .btn,
.container-xxl h4.fw-bold:first-child .btn {
    margin-left: auto;
}

.btn {
    border-radius: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: none;
}

.btn-primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--pns-brand-start) 0%, var(--pns-brand-end) 100%);
    box-shadow: 0 10px 20px rgba(122, 22, 154, 0.14);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    border-color: transparent !important;
    background: linear-gradient(135deg, #5318a2 0%, #df6b11 100%) !important;
}

.btn-outline-primary {
    border-color: rgba(95, 31, 178, 0.28);
    color: var(--pns-brand-mid);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: rgba(95, 31, 178, 0.08);
    border-color: rgba(95, 31, 178, 0.35);
    color: var(--pns-brand-mid);
}

.btn-info,
.btn-success,
.btn-warning,
.btn-danger,
.btn-secondary {
    border-color: transparent;
}

.badge,
.bg-label-primary,
.bg-label-success,
.bg-label-danger,
.bg-label-warning,
.bg-label-info,
.bg-label-secondary {
    border-radius: 999px;
    font-weight: 600;
}

.form-control,
.form-select,
.input-group-text,
.select2-container--bootstrap4 .select2-selection,
.select2-container--default .select2-selection--single {
    min-height: 48px;
    border-radius: 14px !important;
    border-color: rgba(208, 217, 235, 0.9) !important;
    background-color: #fff;
    box-shadow: none !important;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(148, 20, 143, 0.35) !important;
    box-shadow: 0 0 0 0.25rem rgba(148, 20, 143, 0.08) !important;
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text {
    border-radius: 14px !important;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7d8ca3;
}

.table-responsive {
    border-radius: 20px;
}

.card .table-responsive {
    border: 1px solid rgba(144, 157, 186, 0.14);
    background: #fff;
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table > thead {
    background: #f6f8ff;
}

.table > :not(caption) > * > * {
    padding: 1.05rem 1rem;
    border-bottom-color: rgba(144, 157, 186, 0.14);
}

.table thead th {
    color: #607089;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 0;
}

.table tbody tr:hover {
    --bs-table-accent-bg: rgba(95, 31, 178, 0.03);
}

.pagination {
    gap: 6px;
    flex-wrap: wrap;
}

.pagination .page-link {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px !important;
    border-color: rgba(208, 217, 235, 0.9);
    color: var(--pns-brand-mid);
    font-weight: 600;
}

.pagination .page-item.active .page-link {
    border-color: transparent;
    background: linear-gradient(135deg, var(--pns-brand-start) 0%, var(--pns-brand-end) 100%);
    box-shadow: 0 12px 22px rgba(122, 22, 154, 0.2);
}

.layout-menu {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(251, 252, 255, 0.98) 100%) !important;
    border-right: 1px solid rgba(144, 157, 186, 0.12);
    box-shadow: 10px 0 28px rgba(31, 45, 85, 0.04);
}

.app-brand {
    height: auto;
    padding: 1.2rem 1.35rem 0.85rem;
}

.app-brand .app-brand-link {
    display: flex;
    align-items: center;
    width: 100%;
}

.app-brand .app-brand-logo img {
    width: 180px !important;
    max-width: 100%;
}

.menu-vertical .menu-inner {
    padding: 0.7rem 0.85rem 1.25rem;
}

.menu-vertical .menu-inner > .menu-item {
    margin: 0.04rem 0 0.18rem !important;
}

.menu-vertical .menu-link {
    border-radius: 16px;
    min-height: 46px;
    padding-top: 0.72rem;
    padding-bottom: 0.72rem;
    color: #61728a;
    font-weight: 600;
    transition: all 0.2s ease;
}

.menu-vertical .menu-inner > .menu-item .menu-link {
    margin: 0 1.25rem 0 0.7rem !important;
}

.menu-vertical .menu-link:hover {
    background: rgba(95, 31, 178, 0.06);
    color: var(--pns-brand-mid);
}

.menu-vertical .menu-item.active > .menu-link {
    color: var(--pns-brand-mid);
    background: linear-gradient(135deg, rgba(95, 31, 178, 0.12) 0%, rgba(244, 123, 18, 0.12) 100%);
    box-shadow: inset 0 0 0 1px rgba(148, 20, 143, 0.08);
}

.layout-wrapper:not(.layout-horizontal) .bg-menu-theme .menu-inner > .menu-item.active::before,
.bg-menu-theme .menu-inner > .menu-item.active::before {
    display: none !important;
}

.menu-vertical .menu-icon {
    color: inherit !important;
}

.layout-navbar.navbar-detached {
    border: 1px solid var(--pns-border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92) !important;
    box-shadow: var(--pns-shadow);
    backdrop-filter: blur(12px);
}

.navbar .dropdown-menu {
    padding: 0.75rem;
}

.navbar .dropdown-item {
    border-radius: 12px;
    font-weight: 500;
}

.navbar .dropdown-item:hover {
    background: rgba(95, 31, 178, 0.06);
}

.content-footer.footer {
    border: 1px solid var(--pns-border);
    border-radius: 20px 20px 0 0;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 -8px 18px rgba(31, 45, 85, 0.03);
    margin: 12px 24px 0;
}

.toast-header {
    background: transparent;
}

.bs-toast {
    min-width: 320px;
    background: #fff !important;
    border: 1px solid rgba(144, 157, 186, 0.16);
}

.bs-toast .toast-header,
.bs-toast .toast-body,
.bs-toast .btn-close,
.bs-toast #toast-title {
    color: var(--pns-ink) !important;
    opacity: 1;
}

.bs-toast .toast-body {
    font-weight: 500;
}

.bs-toast.pns-toast-success {
    box-shadow: 0 12px 28px rgba(34, 197, 94, 0.16);
    border-left: 4px solid #22c55e;
}

.bs-toast.pns-toast-danger {
    box-shadow: 0 12px 28px rgba(239, 68, 68, 0.14);
    border-left: 4px solid #ef4444;
}

.alert {
    border: 1px solid rgba(144, 157, 186, 0.14);
    border-radius: 18px;
}

.modal-header,
.modal-footer {
    border-color: rgba(144, 157, 186, 0.14);
}

.auth-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(95, 31, 178, 0.08), transparent 24%),
        radial-gradient(circle at bottom right, rgba(244, 123, 18, 0.1), transparent 22%),
        linear-gradient(135deg, #fff 0%, #f7f7ff 55%, #fffaf6 100%);
}

.auth-shell .authentication-inner {
    max-width: 460px;
}

.auth-shell .card {
    border-radius: 24px;
}

.auth-shell .card-body {
    padding: 1.75rem;
}

.auth-shell .auth-brand img {
    width: 210px !important;
    max-width: 100%;
}

.auth-shell .auth-title {
    margin-bottom: 0.5rem;
    font-size: 1.7rem;
    font-weight: 700;
}

.auth-shell .auth-copy {
    margin-bottom: 1.5rem;
    color: var(--pns-muted);
}

.auth-shell .auth-divider {
    margin: 1.2rem 0 1.5rem;
    border-top: 1px solid rgba(144, 157, 186, 0.16);
}

.pns-page-card {
    border-radius: 28px;
}

.pns-filter-row {
    padding: 20px;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #f9fbff 100%);
    border: 1px solid rgba(144, 157, 186, 0.14);
}

.pns-top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 1199.98px) {
    .content-footer.footer {
        margin: 12px 12px 0;
    }
}

@media (max-width: 767.98px) {
    .container-xxl > h4.fw-bold,
    .content-wrapper h4.fw-bold:first-child,
    .container-xxl h4.fw-bold:first-child {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-shell .card-body {
        padding: 1.5rem;
    }
}
