/*
 * UI Enhancement Layer - Global Backend Styles
 * Applies to ALL backend views via master layout
 * Animations, Glassmorphism, Micro-interactions, Psychology-driven design
 */

/* ===== CSS Variables for Theme Control ===== */
:root {
    --ui-primary: var(--sidebar-primary);
    --ui-primary-dark: var(--sidebar-primary);
    --ui-success: #059669;
    --ui-danger: #dc2626;
    --ui-warning: #f59e0b;
    --ui-info: #0ea5e9;
    --ui-gradient: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-dark));
    --ui-shadow: 0 10px 40px rgba(102, 126, 234, 0.12);
    --ui-radius: 14px;
    --ui-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --ui-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ===== Page Load Animation ===== */
.dashboard-content {
    animation: pageSlideIn 0.4s ease-out both;
}

@keyframes pageSlideIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== Card Enhancements (All .card elements) ===== */
.card {
    border: none !important;
    border-radius: var(--ui-radius) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
    transition: box-shadow 0.3s ease;
    overflow: visible;
    background: rgba(255, 255, 255, 0.97) !important;
}

.card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08) !important;
}

.card-body {
    padding: 1.5rem !important;
}

/* ===== Table Enhancements ===== */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9) !important;
    border: none !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 14px 12px !important;
    white-space: nowrap;
}

.table tbody tr {
    transition: var(--ui-transition);
    animation: rowFadeIn 0.4s ease both;
}

.table tbody tr:nth-child(1) {
    animation-delay: 0.02s;
}

.table tbody tr:nth-child(2) {
    animation-delay: 0.04s;
}

.table tbody tr:nth-child(3) {
    animation-delay: 0.06s;
}

.table tbody tr:nth-child(4) {
    animation-delay: 0.08s;
}

.table tbody tr:nth-child(5) {
    animation-delay: 0.10s;
}

.table tbody tr:nth-child(6) {
    animation-delay: 0.12s;
}

.table tbody tr:nth-child(7) {
    animation-delay: 0.14s;
}

.table tbody tr:nth-child(8) {
    animation-delay: 0.16s;
}

.table tbody tr:nth-child(9) {
    animation-delay: 0.18s;
}

.table tbody tr:nth-child(10) {
    animation-delay: 0.20s;
}

@keyframes rowFadeIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.table tbody tr:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03), rgba(118, 75, 162, 0.03)) !important;
    transform: scale(1.002);
}

.table tbody td {
    border-color: #f1f5f9 !important;
    padding: 12px !important;
    vertical-align: middle !important;
    font-size: 0.84rem;
}

/* ===== Button Style Enhancements ===== */
.btn-primary,
.btn-info,
.btn-success {
    background: var(--ui-gradient) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
    transition: all 0.4s var(--ui-bounce) !important;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover,
.btn-info:hover,
.btn-success:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4) !important;
}

.btn-primary::after,
.btn-info::after,
.btn-success::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.6s;
}

.btn-primary:hover::after,
.btn-info:hover::after,
.btn-success:hover::after {
    left: 100%;
}

.btn-danger {
    transition: all 0.3s var(--ui-bounce) !important;
}

.btn-danger:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3) !important;
}

.btn-secondary,
.btn-default {
    transition: var(--ui-transition) !important;
}

.btn-secondary:hover,
.btn-default:hover {
    transform: translateY(-2px) !important;
}

/* ===== Form Enhancements - Consistent Sizing ===== */
/* Unified height/padding/font for ALL form elements */
:root {
    --form-height: 42px;
    --form-padding-y: 10px;
    --form-padding-x: 14px;
    --form-font-size: 0.875rem;
    --form-border-radius: 10px;
    --form-border: 2px solid #e5e7eb;
    --form-bg: #fafbfc;
    --form-focus-border: var(--ui-primary);
}

.form-control,
.form-select,
select.form-control,
input.form-control,
textarea.form-control,
.custom-select,
.input-group .form-control,
.modern-input,
.modern-form-input {
    height: var(--form-height) !important;
    min-height: var(--form-height) !important;
    padding: var(--form-padding-y) var(--form-padding-x) !important;
    font-size: var(--form-font-size) !important;
    line-height: 1.5 !important;
    border: var(--form-border) !important;
    border-radius: var(--form-border-radius) !important;
    background: var(--form-bg) !important;
    transition: var(--ui-transition) !important;
    box-sizing: border-box !important;
    color: #1e293b !important;
}

/* Textarea exception - allow auto height */
textarea.form-control {
    height: auto !important;
    min-height: 80px !important;
}

/* Input text color fix - ensure dark text always */
input,
select,
textarea,
.form-control,
.form-select {
    color: #1e293b !important;
}

input::placeholder,
.form-control::placeholder,
textarea::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

input:-webkit-autofill {
    -webkit-text-fill-color: #1e293b !important;
    box-shadow: 0 0 0 1000px #fafbfc inset !important;
}

/* Auth page label fix - light text on dark backgrounds */
.auth-page-wrapper label,
.auth-card label,
.auth-container label,
[class*="auth"] label {
    color: #e2e8f0 !important;
}

.auth-page-wrapper .form-check-label,
.auth-card .form-check-label,
[class*="auth"] .form-check-label {
    color: #cbd5e1 !important;
}

.auth-page-wrapper p,
.auth-page-wrapper span,
.auth-card p,
.auth-card span {
    color: #cbd5e1 !important;
}

.auth-page-wrapper h1,
.auth-page-wrapper h2,
.auth-page-wrapper h3,
.auth-page-wrapper h4,
.auth-page-wrapper h5,
.auth-page-wrapper h6,
.auth-card h1,
.auth-card h2,
.auth-card h3,
.auth-card h4,
.auth-card h5,
.auth-card h6 {
    color: #fff !important;
}

.auth-page-wrapper a:not(.btn) {
    color: #a78bfa !important;
}

.auth-page-wrapper a:not(.btn):hover {
    color: #c4b5fd !important;
}

/* Select2 consistent sizing & modern styling */
.select2-container--default .select2-selection--single {
    height: var(--form-height) !important;
    min-height: var(--form-height) !important;
    padding: var(--form-padding-y) var(--form-padding-x) !important;
    border: var(--form-border) !important;
    border-radius: var(--form-border-radius) !important;
    background: var(--form-bg) !important;
    font-size: var(--form-font-size) !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.5 !important;
    padding: 0 !important;
    font-size: var(--form-font-size) !important;
    color: #374151 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: var(--form-height) !important;
    top: 0 !important;
    right: 8px !important;
}

.select2-container--default .select2-selection--multiple {
    min-height: var(--form-height) !important;
    padding: 4px var(--form-padding-x) !important;
    border: var(--form-border) !important;
    border-radius: var(--form-border-radius) !important;
    background: var(--form-bg) !important;
    font-size: var(--form-font-size) !important;
}

.select2-container .select2-selection--single:focus,
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--form-focus-border) !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1) !important;
}

.select2-dropdown {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.04) !important;
    margin-top: 4px !important;
    background-color: #ffffff !important;
    padding: 6px !important;
    z-index: 9999 !important;
}

.select2-search--dropdown {
    padding: 4px 6px 8px 6px !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 7px 12px !important;
    outline: none !important;
    font-size: 0.85rem !important;
    background-color: #f8fafc !important;
    color: #1e293b !important;
    transition: all 0.2s ease !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #6366f1 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.select2-results__options {
    max-height: 240px !important;
    padding: 2px !important;
}

.select2-results__option {
    padding: 8px 12px !important;
    font-size: 0.875rem !important;
    border-radius: 8px !important;
    margin-bottom: 2px !important;
    color: #334155 !important;
    font-weight: 500 !important;
    transition: all 0.15s ease !important;
}

.select2-results__option--highlighted[aria-selected],
.select2-results__option--highlighted {
    background-color: #eef2ff !important;
    color: #4f46e5 !important;
    font-weight: 600 !important;
}

.select2-results__option[aria-selected="true"] {
    background-color: #6366f1 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* Input group consistent sizing */
.input-group {
    height: var(--form-height);
}

.input-group-text {
    height: var(--form-height) !important;
    padding: var(--form-padding-y) 12px !important;
    font-size: var(--form-font-size) !important;
    border: var(--form-border) !important;
    border-radius: var(--form-border-radius) !important;
    background: #f1f5f9 !important;
}

/* File input consistent */
input[type="file"].form-control {
    padding: 8px var(--form-padding-x) !important;
    line-height: 1.6 !important;
}

/* Focus states */
.form-control:focus,
select.form-control:focus,
input.form-control:focus,
.modern-input:focus,
.modern-form-input:focus {
    border-color: var(--form-focus-border) !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1) !important;
    background: #fff !important;
    transform: translateY(-1px);
}

.form-control.is-invalid:focus {
    border-color: var(--ui-danger) !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1) !important;
}

/* Labels consistent */
label,
.form-group label,
.form-group-modern label,
.col-form-label {
    font-weight: 600 !important;
    color: #374151 !important;
    font-size: 0.84rem !important;
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
}

/* Select native arrow */
select.form-control,
.form-select {
    appearance: none !important;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    padding-right: 36px !important;
}

/* Buttons consistent height with form elements */
.btn {
    height: var(--form-height);
    padding: var(--form-padding-y) 20px !important;
    font-size: var(--form-font-size) !important;
    border-radius: var(--form-border-radius) !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    line-height: 1 !important;
}

.btn-sm {
    height: 34px !important;
    padding: 6px 14px !important;
    font-size: 0.78rem !important;
}

.btn-lg {
    height: 50px !important;
    padding: 12px 28px !important;
    font-size: 0.95rem !important;
}

/* Datepicker input consistent */
[data-toggle="datepicker"] {
    height: var(--form-height) !important;
    padding: var(--form-padding-y) var(--form-padding-x) !important;
    font-size: var(--form-font-size) !important;
}

/* ===== Breadcrumb Enhancement ===== */
.breadcrumb {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    border-radius: 10px !important;
    padding: 12px 18px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.breadcrumb-item a {
    color: var(--ui-primary) !important;
    text-decoration: none;
    font-weight: 500;
    transition: var(--ui-transition);
}

.breadcrumb-item a:hover {
    color: var(--ui-primary-dark) !important;
}

.breadcrumb-item.active {
    color: #64748b !important;
    font-weight: 600;
}

/* ===== Badge/Status Enhancements ===== */
.badge {
    border-radius: 20px !important;
    padding: 5px 12px !important;
    font-weight: 600 !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.3px;
}

.badge-success,
.bg-success {
    background: #ecfdf5 !important;
    color: #059669 !important;
}

.badge-danger,
.bg-danger {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

.badge-warning,
.bg-warning {
    background: #fffbeb !important;
    color: #d97706 !important;
}

.badge-info,
.bg-info {
    background: #e0f2fe !important;
    color: #0284c7 !important;
}

/* ===== Pagination Enhancement ===== */
.pagination .page-item .page-link {
    border: none !important;
    border-radius: 8px !important;
    margin: 0 3px;
    font-weight: 600;
    color: #64748b;
    transition: var(--ui-transition);
    min-width: 36px;
    text-align: center;
}

.pagination .page-item.active .page-link {
    background: var(--ui-gradient) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pagination .page-item .page-link:hover {
    background: #f1f5f9;
    color: var(--ui-primary);
    transform: translateY(-2px);
}

/* ===== Modal Enhancement ===== */
.modal-content {
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15) !important;
}

.modal.show .modal-content {
    animation: modalPop 0.4s var(--ui-bounce) both;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 1.2rem 1.5rem !important;
}

.modal-footer {
    border-top: 1px solid #f1f5f9 !important;
    padding: 1rem 1.5rem !important;
}

/* ===== Sidebar Enhancement ===== */
.nav-left-sidebar {
    scroll-behavior: smooth;
}

.nav-left-sidebar::-webkit-scrollbar {
    width: 4px;
}

.nav-left-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.nav-left-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.nav-left-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Submenu expand transition */
.nav-left-sidebar .collapse,
.nav-left-sidebar .collapsing {
    transition: height 0.3s ease !important;
}

.nav-left-sidebar .submenu,
.nav-left-sidebar .sa-submenu {
    transition: all 0.3s ease;
}

.nav-left-sidebar .navbar-nav .nav-link {
    border-radius: 8px !important;
    margin: 2px 8px;
    transition: var(--ui-transition) !important;
}

.nav-left-sidebar .navbar-nav .nav-link:hover {
    background: rgba(102, 126, 234, 0.08) !important;
    transform: translateX(3px);
}

.nav-left-sidebar .navbar-nav .nav-link.active {
    background: var(--ui-gradient) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ===== Alert Enhancements ===== */
.alert {
    border: none !important;
    border-radius: 12px !important;
    padding: 14px 20px !important;
    animation: alertSlide 0.4s ease both;
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Tooltip Custom ===== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: #1e293b;
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* ===== Scrollbar Enhancement ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--ui-primary), var(--ui-primary-dark));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ui-primary-dark);
}

/* ===== Loading Skeleton ===== */
.skeleton-loading {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ===== Floating Action Pulse ===== */
.pulse-dot {
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--ui-danger);
    border-radius: 50%;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
}

/* ===== Image Hover Zoom ===== */
.table img,
img.img-thumbnail {
    transition: var(--ui-transition) !important;
    border-radius: 8px !important;
}

.table img:hover,
img.img-thumbnail:hover {
    transform: scale(1.8);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 100;
    position: relative;
}

/* ===== Empty State ===== */
.dataTables_empty,
.table tbody tr td[colspan] {
    padding: 3rem !important;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
}

/* ===== Counter/Number Highlight ===== */
.info-box .info-box-number,
.stat-number,
h3.fw-bold,
.h4.mb-0 {
    background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Page Header Enhancement ===== */
.page-header {
    margin-bottom: 1rem;
}

.pageheader-title {
    font-weight: 800 !important;
    color: #1e293b !important;
    position: relative;
    display: inline-block;
}

.pageheader-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--ui-gradient);
    border-radius: 3px;
}

/* ============================================================
   ADVANCED UI/UX PATTERNS - Super Admin Level
   Gradient Stats, 3D Tilt, View Toggle, Filter Cards, etc.
   ============================================================ */

/* ===== Gradient Stat Cards (Dashboard) ===== */
.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.gradient-stat-card {
    border-radius: 16px;
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
    cursor: pointer;
    text-decoration: none !important;
    display: block;
    color: #fff !important;
}

.gradient-stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    color: #fff !important;
}

.gradient-stat-card .stat-wave {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.gradient-stat-card .stat-wave::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.gradient-stat-card .stat-body {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.gradient-stat-card .stat-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
}

.gradient-stat-card .stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
}

.gradient-stat-card .stat-label {
    font-size: 0.78rem;
    opacity: 0.85;
    margin: 0;
    font-weight: 500;
}

/* Gradient variants */
.gradient-stat-card.stat-purple {
    background: var(--sidebar-primary);
}

.gradient-stat-card.stat-orange {
    background: linear-gradient(135deg, #f7971e, #ffd200);
}

.gradient-stat-card.stat-green {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

.gradient-stat-card.stat-red {
    background: linear-gradient(135deg, #eb3349, #f45c43);
}

.gradient-stat-card.stat-blue {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
}

.gradient-stat-card.stat-teal {
    background: linear-gradient(135deg, #0d9488, #2dd4bf);
}

.gradient-stat-card.stat-pink {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
}

.gradient-stat-card.stat-indigo {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

/* Staggered animation */
.stat-cards-grid>*:nth-child(1) {
    animation: statSlideUp 0.5s ease-out 0.05s both;
}

.stat-cards-grid>*:nth-child(2) {
    animation: statSlideUp 0.5s ease-out 0.1s both;
}

.stat-cards-grid>*:nth-child(3) {
    animation: statSlideUp 0.5s ease-out 0.15s both;
}

.stat-cards-grid>*:nth-child(4) {
    animation: statSlideUp 0.5s ease-out 0.2s both;
}

.stat-cards-grid>*:nth-child(5) {
    animation: statSlideUp 0.5s ease-out 0.25s both;
}

.stat-cards-grid>*:nth-child(6) {
    animation: statSlideUp 0.5s ease-out 0.3s both;
}

.stat-cards-grid>*:nth-child(7) {
    animation: statSlideUp 0.5s ease-out 0.35s both;
}

.stat-cards-grid>*:nth-child(8) {
    animation: statSlideUp 0.5s ease-out 0.4s both;
}

@keyframes statSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== Hero Banner (Reusable) ===== */
.hero-banner,
.dash-hero,
.parcel-hero,
.merch-hero,
.hub-hero,
[class*="-hero"] {
    background: var(--sidebar-primary);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.25);
}

.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hero-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.pulse-ring {
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.hero-text h2 {
    color: #fff;
    font-weight: 800;
    margin: 0;
    font-size: 1.5rem;
}

.hero-text>p {
    color: rgba(255, 255, 255, 0.8);
    margin: 4px 0 0;
    font-size: 0.85rem;
}

.hero-lottie {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
    z-index: 0;
}

.hero-particles {
    position: absolute;
    inset: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.p1 {
    width: 100px;
    height: 100px;
    top: -30px;
    right: 8%;
    animation: floatP 6s ease-in-out infinite;
}

.p2 {
    width: 50px;
    height: 50px;
    bottom: -15px;
    left: 12%;
    animation: floatP 8s ease-in-out infinite reverse;
}

.p3 {
    width: 70px;
    height: 70px;
    top: 30%;
    left: 40%;
    animation: floatP 7s ease-in-out infinite 1s;
}

@keyframes floatP {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Hero Stats (inside hero banner) */
.hero-stats {
    display: flex;
    gap: 20px;
    margin-top: 12px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
}

.hero-stat-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
}

.hero-stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hero Add Button */
.btn-hero-add {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-hero-add:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: #fff !important;
}

.btn-hero-add-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: btnShine 3s ease-in-out infinite;
}

@keyframes btnShine {
    0% {
        left: -100%;
    }

    50% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

/* ===== Filter Card ===== */
.filter-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #f1f5f9;
}

.filter-header {
    padding: 14px 20px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-header i {
    color: var(--ui-primary);
}

.filter-body {
    padding: 20px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
}

.filter-field {
    flex: 1;
    min-width: 180px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ===== Statement Cards (Dashboard) ===== */
.statement-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.statement-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

.statement-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.statement-card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.statement-card-header .stmt-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.statement-card-header h5 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
}

.statement-card-body {
    padding: 0;
}

.statement-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.2s;
}

.statement-row:last-child {
    border-bottom: none;
}

.statement-row:hover {
    background: #fafbfc;
}

.statement-row .stmt-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #475569;
}

.statement-row .stmt-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
}

.statement-row .stmt-value.income {
    color: #059669;
}

.statement-row .stmt-value.expense {
    color: #dc2626;
}

.statement-row .stmt-value.balance {
    color: var(--sidebar-primary);
}

/* ===== Chart Card Enhancement ===== */
.chart-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #f1f5f9;
}

.chart-card .card-header-custom {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
}

.chart-card .card-header-custom h5 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-card .card-header-custom .chart-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.chart-card .chart-body {
    padding: 20px;
}

.chart-card .chart-footer {
    padding: 14px 24px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
}

.chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ===== View Toggle (Grid/Table) ===== */
.list-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 14px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 18px;
    border: 1px solid #f1f5f9;
}

.list-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-header-left h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.list-header-left .count-badge {
    background: #f1f5f9;
    color: #64748b;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.list-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-toggle {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
}

.view-toggle .view-btn {
    border: none;
    background: transparent;
    padding: 8px 12px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.view-toggle .view-btn.active {
    background: var(--sidebar-primary);
    color: #fff;
}

.view-toggle .view-btn:hover:not(.active) {
    color: var(--sidebar-primary);
}

/* ===== Section Header ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header .sec-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.section-header .view-all {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sidebar-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.section-header .view-all:hover {
    color: var(--sidebar-primary);
    transform: translateX(3px);
}

/* ===== 3D Tilt Effect ===== */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.1s ease;
}

.tilt-card .tilt-inner {
    transform: translateZ(20px);
}

/* ===== Calendar Enhancement ===== */
.calendar-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    border: 1px solid #eef2f7;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
}

.calendar-card .calendar-header {
    padding: 16px 20px;
    background: #fff;
    color: #0f172a;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.calendar-header-label {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #334155;
}

.calendar-header-hint {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sidebar-primary, #2563eb);
    background: color-mix(in srgb, var(--sidebar-primary, #2563eb) 10%, #fff);
    border: 1px solid color-mix(in srgb, var(--sidebar-primary, #2563eb) 18%, #fff);
    border-radius: 999px;
    padding: 5px 10px;
}

.calendar-card .calendar-body {
    padding: 14px 16px 18px;
    display: flex;
    flex: 1 1 auto;
    min-height: 420px;
}

.modern-calendar {
    width: 100%;
    height: 100%;
    min-height: 390px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modern-calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}

.modern-calendar-nav {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modern-calendar-nav:hover {
    background: #f8fafc;
    border-color: color-mix(in srgb, var(--sidebar-primary, #2563eb) 35%, #e2e8f0);
    color: var(--sidebar-primary, #2563eb);
}

.modern-calendar-month {
    border: none;
    background: transparent;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    padding: 8px 12px;
    border-radius: 10px;
}

.modern-calendar-month:hover {
    background: #f8fafc;
}

.modern-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    flex-shrink: 0;
}

.modern-calendar-weekdays span {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 4px 0;
}

.modern-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(0, 1fr));
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
}

.modern-calendar-day {
    width: 100%;
    height: 100%;
    min-height: 48px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.modern-calendar-day:hover {
    background: #eef2ff;
    border-color: color-mix(in srgb, var(--sidebar-primary, #2563eb) 25%, transparent);
    color: var(--sidebar-primary, #2563eb);
}

.modern-calendar-day.is-outside {
    background: #fff;
    color: #cbd5e1;
    font-weight: 600;
}

.modern-calendar-day.is-today {
    border-color: color-mix(in srgb, var(--sidebar-primary, #2563eb) 45%, #e2e8f0);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sidebar-primary, #2563eb) 20%, transparent);
}

.modern-calendar-day.is-selected {
    background: var(--sidebar-primary, #2563eb) !important;
    color: #fff !important;
    border-color: transparent;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--sidebar-primary, #2563eb) 28%, transparent);
}

@media (max-width: 991.98px) {
    .calendar-card .calendar-body {
        min-height: 360px;
    }

    .modern-calendar {
        min-height: 340px;
    }

    .modern-calendar-day {
        min-height: 42px;
        font-size: 0.92rem;
        border-radius: 12px;
    }
}

/* ===== Machine Clock (Dashboard) — white ===== */
.machine-clock-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    border: 1px solid #eef2f7;
    color: #0f172a;
    position: relative;
    display: flex;
    flex-direction: column;
}

.machine-clock-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--sidebar-primary, #2563eb) 10%, transparent), transparent 42%),
        radial-gradient(circle at bottom left, rgba(148, 163, 184, 0.12), transparent 40%);
    pointer-events: none;
}

.machine-clock-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
}

.machine-clock-label {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #334155;
}

.machine-clock-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: 5px 10px;
}

.machine-clock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
    animation: machinePulse 1.6s ease-out infinite;
}

@keyframes machinePulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.machine-clock-body {
    position: relative;
    z-index: 1;
    padding: 28px 20px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    gap: 18px;
    flex: 1;
}

.machine-clock-ring {
    position: relative;
    width: 210px;
    height: 210px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 50%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.machine-clock-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.machine-clock-ring .ring-track {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 6;
}

.machine-clock-ring .ring-progress {
    fill: none;
    stroke: var(--sidebar-primary, #2563eb);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 326.726;
    stroke-dashoffset: 326.726;
    transition: stroke-dashoffset 0.35s linear;
}

.machine-clock-core {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.machine-clock-time {
    font-family: "Segoe UI", "Roboto Mono", ui-monospace, monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.machine-clock-ampm {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--sidebar-primary, #2563eb);
}

.machine-clock-meta {
    text-align: center;
}

.machine-clock-date {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.machine-clock-day {
    margin-top: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

@media (max-width: 991.98px) {
    .machine-clock-body {
        min-height: 280px;
        padding: 22px 16px;
    }

    .machine-clock-ring {
        width: 180px;
        height: 180px;
    }

    .machine-clock-time {
        font-size: 1.65rem;
    }
}

/* ===== Micro-interaction: Magnetic Button ===== */
.btn-magnetic {
    transition: transform 0.2s ease;
}

/* ===== Glassmorphism Card Variant ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

/* ===== Progress Bar Enhancement ===== */
.progress {
    border-radius: 10px !important;
    height: 8px !important;
    background: #f1f5f9 !important;
    overflow: hidden;
}

.progress-bar {
    background: var(--ui-gradient) !important;
    border-radius: 10px !important;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Data Card (for list items) ===== */
.data-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.data-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
    border-color: #e2e8f0;
}

/* ===== Notification Dot ===== */
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

/* ===== Responsive Micro-adjustments ===== */
@media (max-width: 768px) {
    .card {
        border-radius: 12px !important;
    }

    .btn-primary,
    .btn-info,
    .btn-success {
        padding: 8px 16px !important;
        font-size: 0.82rem !important;
    }

    .table thead th {
        font-size: 0.68rem !important;
        padding: 10px 8px !important;
    }

    .stat-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 12px;
    }

    .gradient-stat-card {
        padding: 16px;
    }

    .gradient-stat-card .stat-value {
        font-size: 1.3rem;
    }

    .hero-banner,
    .dash-hero,
    .parcel-hero,
    .merch-hero,
    .hub-hero,
    [class*="-hero"] {
        padding: 1.5rem;
    }

    .hero-text h2 {
        font-size: 1.2rem;
    }

    .hero-stats {
        gap: 12px;
    }

    .statement-cards {
        grid-template-columns: 1fr;
    }

    .list-header-bar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-field {
        min-width: 100%;
    }
}

/* ===== Selection Color ===== */
::selection {
    background: rgba(102, 126, 234, 0.2);
    color: #1e293b;
}

/* ===== Focus Ring for Accessibility ===== */
*:focus-visible {
    outline: 2px solid var(--ui-primary) !important;
    outline-offset: 2px;
    border-radius: 4px;
}



/* ===== Action Button Dropdown - Fixed position above table ===== */
.table-responsive {
    overflow: visible !important;
}

table .dropdown {
    position: relative !important;
    display: inline-block !important;
}

table .dropdown-menu {
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
}

/* Body-level cloned dropdown menu (floats above everything) */
.dropdown-menu-body-clone {
    position: fixed !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18) !important;
    padding: 8px !important;
    min-width: 160px !important;
    z-index: 99999 !important;
    background: #fff !important;
    animation: dropUp 0.2s ease both;
    height: auto !important;
    min-height: 0 !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
}

.dropdown-menu-body-clone .dropdown-item {
    border-radius: 8px !important;
    padding: 9px 14px !important;
    font-size: 0.82rem !important;
    color: #374151 !important;
    transition: all 0.15s ease;
}

.dropdown-menu-body-clone .dropdown-item:hover {
    background-color: var(--hando-hover-subtle, rgba(59, 130, 246, 0.08)) !important;
    background-image: none !important;
    color: #0f172a !important;
}

.dropdown-menu-body-clone .dropdown-item i {
    width: 18px;
    text-align: center;
    margin-right: 8px;
}

@keyframes dropDown {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes dropUp {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

table .dropdown-menu .dropdown-item {
    border-radius: 8px !important;
    padding: 9px 14px !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    color: #374151 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.2s !important;
    margin: 2px 0 !important;
}

table .dropdown-menu .dropdown-item:hover {
    background-color: var(--hando-hover-subtle, rgba(59, 130, 246, 0.08)) !important;
    background-image: none !important;
    color: #0f172a !important;
    transform: translateX(3px);
}

table .dropdown-menu .dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 0.78rem;
}

table .dropdown-menu .dropdown-item:has(i.fa-edit),
table .dropdown-menu .dropdown-item:has(i.fas.fa-edit),
table .dropdown-menu .dropdown-item:has(i.fas.fa-pen) {
    color: #2563eb !important;
}

table .dropdown-menu .dropdown-item:has(i.fa-edit):hover,
table .dropdown-menu .dropdown-item:has(i.fas.fa-edit):hover,
table .dropdown-menu .dropdown-item:has(i.fas.fa-pen):hover {
    background: rgba(37, 99, 235, 0.08) !important;
    color: #1d4ed8 !important;
}

table .dropdown-menu .dropdown-item:has(i.fa-trash),
table .dropdown-menu .dropdown-item:has(i.fas.fa-trash),
table .dropdown-menu .dropdown-item:has(i.fas.fa-trash-alt) {
    color: #dc2626 !important;
}

table .dropdown-menu .dropdown-item:has(i.fa-trash):hover,
table .dropdown-menu .dropdown-item:has(i.fas.fa-trash):hover,
table .dropdown-menu .dropdown-item:has(i.fas.fa-trash-alt):hover {
    background: rgba(220, 38, 38, 0.08) !important;
    color: #b91c1c !important;
}

/* Action Toggle Button (table actions only) */
table .dropdown-toggle,
table .btn.dropdown-toggle {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 0 !important;
    font-size: 0.85rem !important;
    color: #475569 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    height: 34px !important;
    width: 34px !important;
    min-width: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

table .dropdown-toggle:hover,
table .btn.dropdown-toggle:hover,
table .dropdown-toggle:focus,
table .btn.dropdown-toggle:focus,
table .dropdown-toggle.show,
table .btn.dropdown-toggle.show {
    transform: translateY(-1px) !important;
    color: var(--sidebar-primary, #2563eb) !important;
    border-color: color-mix(in srgb, var(--sidebar-primary, #2563eb) 35%, #e2e8f0) !important;
    background: #f8fafc !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08) !important;
}

/* Hide bootstrap caret on icon-only action menus */
table .dropdown-toggle::after,
table .btn.dropdown-toggle::after {
    display: none !important;
}

table .dropdown-toggle-split {
    border-radius: 10px !important;
}

/* Modern triple-dot action menu */
.table-action-dropdown {
    display: inline-flex;
    position: relative;
}

.table-action-toggle {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    background: #fff !important;
    color: #64748b !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

.table-action-toggle::after {
    display: none !important;
}

.table-action-menu {
    min-width: 180px !important;
    padding: 8px !important;
    border-radius: 14px !important;
    border: 1px solid #eef2f7 !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12) !important;
    z-index: 2000 !important;
}

.table-action-menu:not(.show) {
    /* Prefer opening toward the left before JS repositions */
    right: 0 !important;
    left: auto !important;
}

.table-action-menu .dropdown-item {
    border-radius: 10px !important;
    padding: 9px 12px !important;
    font-size: 0.84rem !important;
    font-weight: 600 !important;
    color: #334155 !important;
    display: flex !important;
    align-items: center !important;
    gap: 2px;
    transition: all 0.18s ease !important;
}

.table-action-menu .dropdown-item:hover {
    background: #f8fafc !important;
    color: #0f172a !important;
}

.table-action-menu .dropdown-item.text-danger:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

.table-action-menu .dropdown-divider {
    margin: 6px 4px !important;
    border-color: #eef2f7 !important;
}

/* Escape table-responsive overflow clipping */
.table-action-menu.dropdown-menu.show,
table tbody td .dropdown-menu.show {
    position: fixed !important;
    z-index: 2000 !important;
    margin: 0 !important;
    inset: auto auto auto auto;
}

table tbody td .dropdown-menu {
    z-index: 2000 !important;
}

/* Inline Action Buttons (for pages that use them) */
.action-btns {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.action-btn {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    border: 1.5px solid #e2e8f0 !important;
    background: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.78rem !important;
    color: #64748b !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    text-decoration: none !important;
    position: relative;
}

.action-btn:hover {
    transform: translateY(-2px) scale(1.1) !important;
}

.action-btn.edit:hover,
.action-btn[title*="Edit"]:hover,
.action-btn[title*="edit"]:hover {
    border-color: var(--sidebar-primary) !important;
    color: var(--sidebar-primary) !important;
    background: #ede9fe !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2) !important;
}

.action-btn.delete:hover,
.action-btn[title*="Delete"]:hover,
.action-btn[title*="delete"]:hover {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    background: #fef2f2 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2) !important;
}

/* ===== Table Action Buttons Spacing (system-wide) ===== */
/* Flex action rows: keep clear space between icon/circle buttons */
table tbody td .d-flex:has(> .btn),
table tbody td .d-flex:has(> a.btn),
table tbody td .d-flex:has(> button.btn),
table tbody td .d-flex:has(> form),
table tbody td .action-btns {
    gap: 8px !important;
    align-items: center !important;
    flex-wrap: wrap;
}

/* Pages where edit/delete sit side-by-side without a flex wrapper */
table tbody td:not(:has(> .d-flex)):not(:has(> .btn-group)):not(:has(> .dropdown)) > .btn,
table tbody td:not(:has(> .d-flex)):not(:has(> .btn-group)):not(:has(> .dropdown)) > a.btn,
table tbody td:not(:has(> .d-flex)):not(:has(> .btn-group)):not(:has(> .dropdown)) > button.btn,
table tbody td:not(:has(> .d-flex)):not(:has(> .btn-group)):not(:has(> .dropdown)) > form {
    margin-right: 8px !important;
    margin-bottom: 2px;
    vertical-align: middle;
}

table tbody td:not(:has(> .d-flex)):not(:has(> .btn-group)):not(:has(> .dropdown)) > .btn:last-child,
table tbody td:not(:has(> .d-flex)):not(:has(> .btn-group)):not(:has(> .dropdown)) > a.btn:last-child,
table tbody td:not(:has(> .d-flex)):not(:has(> .btn-group)):not(:has(> .dropdown)) > button.btn:last-child,
table tbody td:not(:has(> .d-flex)):not(:has(> .btn-group)):not(:has(> .dropdown)) > form:last-child {
    margin-right: 0 !important;
}

/* Keep single-button forms aligned with neighboring action buttons */
table tbody td form.d-inline,
table tbody td form.d-inline-block {
    display: inline-flex !important;
    align-items: center;
    vertical-align: middle;
}

/* Compact circle / icon action buttons stay even size */
table tbody td .btn.rounded-circle {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px;
    padding: 0 !important;
    flex-shrink: 0;
}

/* Icon-only small buttons (no text) look less cramped */
table tbody td .btn.btn-sm:not(.dropdown-toggle) {
    min-width: 34px;
}


/* ============================================================
   SUPER ADMIN NAVBAR & SIDEBAR ENHANCEMENTS (sa- prefix)
   Glassmorphism, Animations, Psychology-driven UX
   ============================================================ */

/* ===== SA Navbar ===== */
.sa-topnav {
    background: #ffffff !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    padding: 8px 0 !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050 !important;
    overflow: visible !important;
}

.sa-topnav.scrolled {
    background: #ffffff !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sa-nav-container {
    padding: 0 24px;
}

.sa-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
}

.sa-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.sa-brand:hover .sa-logo {
    transform: scale(1.05);
}

.sa-brand-badge {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Nav Links */
.sa-nav-link {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 14px !important;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
}

.sa-nav-link:hover {
    color: var(--sidebar-primary) !important;
    background: rgba(102, 126, 234, 0.08);
    transform: translateY(-1px);
}

.sa-nav-link.active {
    color: var(--sidebar-primary, var(--sidebar-primary)) !important;
    background: rgba(102, 126, 234, 0.1);
    font-weight: 600;
}

.sa-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 3px;
    background: var(--sidebar-primary, var(--sidebar-primary));
    border-radius: 3px;
}

.sa-nav-link i {
    font-size: 14px;
    width: 18px;
    text-align: center;
}

/* Icon Buttons */
.sa-icon-btn {
    width: 38px;
    height: 38px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #4a5568 !important;
    transition: all 0.3s ease;
    position: relative;
    font-size: 16px;
}

.sa-icon-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--sidebar-primary) !important;
    transform: translateY(-2px);
}

/* Notification Bell Animation */
.sa-notification-bell i {
    animation: none;
    transition: transform 0.3s ease;
}

.sa-notification-bell:hover i {
    animation: bellRing 0.6s ease;
}

@keyframes bellRing {
    0% {
        transform: rotate(0);
    }

    15% {
        transform: rotate(14deg);
    }

    30% {
        transform: rotate(-14deg);
    }

    45% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(-8deg);
    }

    75% {
        transform: rotate(4deg);
    }

    100% {
        transform: rotate(0);
    }
}

.sa-badge-count {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgeBounce 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

@keyframes badgeBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* Nav Separator */
.sa-nav-separator {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    margin: 0 8px;
}

/* SA Dropdown Menus */
.sa-dropdown {
    position: relative !important;
}

.sa-dropdown-menu {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.03) !important;
    padding: 8px !important;
    min-width: 200px !important;
    background: #ffffff !important;
    position: absolute !important;
    top: 100% !important;
    bottom: auto !important;
    margin-top: 8px !important;
    margin-bottom: 0 !important;
    transform: none !important;
    inset: unset !important;
    z-index: 99999 !important;
}

@keyframes saDropIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sa-dropdown-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--sidebar-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
}

.sa-dropdown-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 14px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    transition: all 0.2s ease !important;
    margin: 2px 0 !important;
}

.sa-dropdown-item:hover {
    background-color: var(--hando-hover-subtle, rgba(59, 130, 246, 0.08)) !important;
    background-image: none !important;
    color: #0f172a !important;
    transform: translateX(4px);
}

.sa-dropdown-item.active {
    background: rgba(102, 126, 234, 0.1) !important;
    color: var(--sidebar-primary) !important;
    font-weight: 600 !important;
}

.sa-dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 13px;
    opacity: 0.7;
}

.sa-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 6px 0;
}

.sa-logout {
    color: #ef4444 !important;
}

.sa-logout:hover {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #dc2626 !important;
}

/* Notification Panel */
.sa-notification-panel {
    width: 340px !important;
    max-height: 420px;
    overflow: hidden;
}

.sa-notification-list {
    max-height: 340px;
    overflow-y: auto;
    padding: 4px;
}

.sa-notification-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
    text-decoration: none !important;
    color: inherit !important;
}

.sa-notification-item:hover {
    background: #f8fafc;
}

.sa-notif-avatar {
    flex-shrink: 0;
}

.sa-notif-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

.sa-notif-content {
    flex: 1;
    min-width: 0;
}

.sa-notif-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    display: block;
}

.sa-notif-text {
    font-size: 12px;
    color: #64748b;
    margin: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sa-notif-time {
    font-size: 11px;
    color: #94a3b8;
}

.sa-notif-time i {
    margin-right: 3px;
}

.sa-notif-count-badge {
    margin-left: auto;
    background: var(--sidebar-primary);
    color: #fff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

.sa-notif-empty {
    text-align: center;
    padding: 30px 20px;
    color: #94a3b8;
}

.sa-notif-empty i {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.sa-notif-empty p {
    font-size: 13px;
    margin: 0;
}

/* User Button */
.sa-user-btn {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px !important;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.sa-user-btn:hover {
    background: rgba(102, 126, 234, 0.06);
}

.sa-user-btn-mobile {
    display: flex;
    align-items: center;
}

.sa-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: border-color 0.3s ease;
}

.sa-user-btn:hover .sa-user-avatar {
    border-color: var(--sidebar-primary);
}

.sa-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.sa-chevron {
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

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

/* User Menu */
.sa-user-menu {
    width: 240px !important;
}

.sa-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--sidebar-primary);
    border-radius: 12px;
    margin: 4px;
    margin-bottom: 8px;
}

.sa-user-header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.sa-user-header h6 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.sa-user-header span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
}

/* Mobile Hamburger */
.sa-hamburger {
    width: 36px;
    height: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s;
}

.sa-hamburger:hover {
    background: rgba(102, 126, 234, 0.08);
}

.sa-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #4a5568;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.sa-hamburger:hover span:nth-child(1) {
    transform: translateY(-1px);
}

.sa-hamburger:hover span:nth-child(3) {
    transform: translateY(1px);
}

/* Mobile Offcanvas */
.sa-offcanvas {
    background: linear-gradient(180deg, #1e1b4b, #312e81) !important;
    width: 280px !important;
    border-right: none !important;
}

.sa-offcanvas-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sa-offcanvas-body {
    padding: 20px;
}

.sa-mobile-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sa-mobile-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.sa-mobile-menu li a:hover,
.sa-mobile-menu li a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(4px);
}

.sa-offcanvas-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

.sa-offcanvas-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
}

.sa-lang-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.sa-lang-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.sa-lang-item:hover,
.sa-lang-item.active {
    background: rgba(102, 126, 234, 0.3);
    color: #fff;
    transform: translateY(-2px);
}

/* ===== SA Sidebar ===== */
.sa-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%) !important;
    border-right: none !important;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.sa-sidebar::-webkit-scrollbar {
    width: 4px;
}

.sa-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sa-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.sa-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

@media screen and (min-width: 992px) {
    .sa-sidebar.sidebar-wrapper {
        position: fixed;
        top: 60px;
        left: 0;
        width: 264px;
        height: calc(100% - 60px);
        z-index: 1000;
    }
}

@media screen and (max-width: 991px) {
    .sa-sidebar.sidebar-wrapper {
        position: static;
        width: 100%;
    }
}

/* Override global nav-left-sidebar styles for dark theme */
.sa-sidebar.nav-left-sidebar .navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.sa-sidebar.nav-left-sidebar .navbar-nav .nav-link.active {
    background: var(--sidebar-primary) !important;
    background-image: none !important;
    color: #fff !important;
}

.sa-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top left, rgba(102, 126, 234, 0.1), transparent 60%),
        radial-gradient(ellipse at bottom right, rgba(118, 75, 162, 0.08), transparent 60%);
    pointer-events: none;
}

.sa-sidebar-inner {
    position: relative;
    z-index: 1;
}

/* Sidebar Brand */
.sa-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sa-sidebar-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.sa-sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Stats */
.sa-sidebar-stats {
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sa-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.sa-stat-dot {
    font-size: 8px;
}

.sa-stat-dot.online {
    color: #34d399;
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Nav Section Titles */
.sa-nav-section-title {
    padding: 18px 20px 8px !important;
    list-style: none;
}

.sa-nav-section-title span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.5);
}

/* Sidebar Nav Items */
.sa-nav {
    /* padding: 8px 12px !important; */
}

.sa-nav-item {
    margin: 2px 0;
}

.sa-nav-item>.sa-nav-link {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 11px 14px !important;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-decoration: none !important;
}

.sa-nav-item>.sa-nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateX(4px);
}

.sa-nav-item>.sa-nav-link.active {
    color: #fff !important;
    background: var(--sidebar-primary, var(--sidebar-primary)) !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transform: none;
}

.sa-nav-icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
    opacity: 0.8;
}

.sa-nav-item>.sa-nav-link.active .sa-nav-icon {
    opacity: 1;
}

.sa-nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Submenu Arrow */
.sa-nav-arrow {
    font-size: 10px;
    opacity: 0.5;
    transition: transform 0.3s ease;
}

.sa-nav-link[aria-expanded="true"] .sa-nav-arrow {
    transform: rotate(90deg);
    opacity: 1;
}

/* Submenu */
.sa-submenu {
    padding: 4px 0 4px 20px;
}

.sa-sub-link {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 9px 14px !important;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.7) !important;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.sa-sub-link:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.sa-sub-link.active {
    color: #a78bfa !important;
    background: rgba(167, 139, 250, 0.1);
    font-weight: 600;
}

.sa-sub-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.sa-sub-link:hover .sa-sub-dot {
    background: var(--sidebar-primary);
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
}

.sa-sub-link.active .sa-sub-dot {
    background: #a78bfa;
    box-shadow: 0 0 8px rgba(167, 139, 250, 0.5);
}

/* Sidebar Footer */
.sa-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
}

.sa-sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sa-sidebar-user-img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid rgba(102, 126, 234, 0.4);
}

.sa-sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sa-sidebar-user-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sa-sidebar-user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* ===== SA Navbar Scroll Effect (JS adds .scrolled class) ===== */
@media (min-width: 992px) {
    .sa-topnav {
        padding: 6px 0 !important;
    }
}

@media (max-width: 991px) {
    .sa-notification-panel {
        width: 300px !important;
    }

    .sa-mobile-nav {
        gap: 4px;
    }
}

/* ===== Future / Roadmap Sidebar Items ===== */
.sa-nav-item.sa-future > .sa-nav-link,
.sa-nav-item.sa-future > span.sa-nav-link {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.sa-future-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(102, 126, 234, 0.25);
    color: rgba(180, 190, 255, 0.9);
    border: 1px solid rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
    white-space: nowrap;
}
/* Modern Modal Styles */
.modern-modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}
.modern-modal-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem;
    position: relative;
    display: flex;
    align-items: center;
}
.modal-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(102, 126, 234, 0.1);
    color: var(--sidebar-primary, #667eea);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 1rem;
}
.modern-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}
.modern-modal-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}
.modern-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #94a3b8;
    transition: color 0.2s ease;
}
.modern-modal-close:hover {
    color: #ef4444;
}
.modern-modal-body {
    padding: 1.5rem;
    background-color: #f8fafc;
}
.modern-modal-footer {
    padding: 1.25rem 1.5rem;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}
.modern-form-group {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.modern-form-group:focus-within {
    border-color: var(--sidebar-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.modern-form-label {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.75rem;
}
.modern-form-label i {
    color: var(--sidebar-primary, #667eea);
    margin-right: 0.5rem;
}
.modern-form-control {
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    width: 100%;
    font-size: 0.875rem;
    transition: all 0.2s;
}
.modern-form-control:focus {
    outline: none;
    border-color: var(--sidebar-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
/* Assign Type Pills */
.assign-type-container {
    display: flex;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 0.375rem;
    border-radius: 0.75rem;
}
.assign-type-btn {
    flex: 1;
    position: relative;
}
.assign-type-btn input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}
.assign-type-btn label {
    display: block;
    padding: 0.5rem 1rem;
    text-align: center;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
}
.assign-type-btn input:checked + label {
    background-color: var(--sidebar-primary, #667eea);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.3);
}
/* Buttons */
.modern-btn-save {
    background-color: var(--sidebar-primary, #667eea);
    color: #fff;
    border: none;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}
.modern-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.modern-btn-cancel {
    background-color: #f1f5f9;
    color: #475569;
    border: none;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}
.modern-btn-cancel:hover {
    background-color: #e2e8f0;
}


/* Rider Settlement Dashboard Styles */
.rs-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.rs-dashboard-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}
.rs-breadcrumb {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}
.rs-breadcrumb a {
    color: var(--sidebar-primary, #667eea);
    text-decoration: none;
}
.rs-filter-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}
.rs-filter-group {
    flex: 1;
}
.rs-filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}
.rs-filter-control {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #334155;
    background-color: #f8fafc;
}
.rs-filter-control:focus {
    outline: none;
    border-color: var(--sidebar-primary, #667eea);
    background-color: #fff;
}
.rs-btn-filter {
    background-color: var(--sidebar-primary, #667eea);
    color: #fff;
    border: none;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    height: 42px;
}
.rs-btn-reset {
    background-color: #f1f5f9;
    color: #475569;
    border: none;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    height: 42px;
}

/* KPI Cards */
.rs-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.rs-kpi-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.rs-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.rs-kpi-icon.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.rs-kpi-icon.green { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.rs-kpi-icon.purple { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.rs-kpi-icon.orange { background: rgba(249, 115, 22, 0.1); color: #f97316; }
.rs-kpi-icon.red { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.rs-kpi-icon.indigo { background: rgba(99, 102, 241, 0.1); color: #6366f1; }

.rs-kpi-content {
    flex: 1;
}
.rs-kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.25rem;
}
.rs-kpi-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.125rem;
}
.rs-kpi-subtext {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Layout Split */
.rs-main-layout {
    display: flex;
    gap: 1.5rem;
}
.rs-main-content {
    flex: 1;
    min-width: 0;
}
.rs-sidebar {
    width: 350px;
    flex-shrink: 0;
}

/* Table Card */
.rs-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}
.rs-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.rs-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.rs-table {
    width: 100%;
    border-collapse: collapse;
}
.rs-table th {
    background-color: #f8fafc;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.rs-table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.rs-table tbody tr:hover {
    background-color: #f8fafc;
}
.rs-table .rider-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: #1e293b;
}
.rs-table .rider-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}
.rs-amount {
    font-family: "JetBrains Mono", monospace;
    font-weight: 600;
}
.rs-amount.positive { color: #10b981; }
.rs-amount.neutral { color: #6366f1; }
.rs-amount.negative { color: #ef4444; }

.rs-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.rs-badge.pending { background: #fef3c7; color: #d97706; border: 1px solid #fde68a; }
.rs-badge.submitted { background: #e0e7ff; color: #4f46e5; border: 1px solid #c7d2fe; }
.rs-badge.verified { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }
.rs-badge.settled { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

/* Sidebar Widget */
.rs-widget {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.rs-widget-header {
    padding: 1.25rem;
    background-color: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.rs-widget-body {
    padding: 1.25rem;
}
.rs-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.rs-info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}
.rs-info-item:not(:last-child) {
    border-bottom: 1px dashed #e2e8f0;
}
.rs-info-label {
    color: #64748b;
}
.rs-info-value {
    font-weight: 600;
    color: #1e293b;
}
.rs-info-value.highlight {
    color: var(--sidebar-primary, #667eea);
}
.rs-summary-total {
    background-color: var(--sidebar-primary, #667eea);
    color: #fff;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.125rem;
}
.rs-action-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.rs-action-btn {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 0.75rem;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.rs-action-btn:hover {
    background-color: #fff;
    border-color: var(--sidebar-primary, #667eea);
    box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.1);
}
.rs-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(102, 126, 234, 0.1);
    color: var(--sidebar-primary, #667eea);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 1rem;
}
.rs-action-text {
    flex: 1;
}
.rs-action-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}
.rs-action-desc {
    font-size: 0.75rem;
    color: #64748b;
}
.rs-timeline {
    position: relative;
    padding-left: 1.5rem;
}
.rs-timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e2e8f0;
}
.rs-timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}
.rs-timeline-item::before {
    content: "";
    position: absolute;
    left: -1.5rem;
    top: 0.25rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #fff;
    border: 3px solid #cbd5e1;
}
.rs-timeline-item.active::before {
    border-color: #22c55e;
}
.rs-timeline-content {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}
.rs-timeline-title {
    font-weight: 600;
    color: #1e293b;
}
.rs-timeline-time {
    color: #64748b;
    font-size: 0.75rem;
}


/* Fixes for Rider Settlement UI */
.rs-dashboard-header {
    margin-bottom: 24px;
}
.rs-filter-card, .rs-kpi-card, .rs-card, .rs-widget {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}
.rs-filter-card {
    padding: 20px;
}
.rs-kpi-grid {
    gap: 16px;
    margin-bottom: 24px;
}
.rs-kpi-card {
    padding: 20px;
}
.rs-kpi-icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
}
.rs-kpi-label {
    font-size: 13px;
    color: #6b7280;
}
.rs-kpi-value {
    font-size: 24px;
    color: #111827;
}
.rs-table th {
    font-size: 12px;
    color: #6b7280;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.rs-table td {
    font-size: 14px;
    color: #374151;
}
.rs-amount {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 14px;
}
.rs-summary-total {
    background-color: #1d4ed8 !important; /* Force Blue */
    color: white !important;
    padding: 16px 20px;
    font-size: 18px;
}
.rs-widget-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}
.rs-info-item {
    font-size: 14px;
}
.rs-timeline-content {
    font-size: 14px;
}
.rs-timeline-time {
    font-size: 12px;
}
.rs-sidebar {
    width: 400px; /* Slightly wider */
}
