/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');

:root {
    /* Color Palette - Sneat Pro Light */
    --primary: #696cff; /* Signature Violet */
    --primary-light: #e8e3ff;
    --primary-hover: #5f61e6;
    --secondary: #8592a3; /* Muted cool-grey */
    --secondary-light: #ebeef0;
    --success: #71dd37; /* Vibrant green */
    --success-light: #e8fadf;
    --warning: #ffab00; /* Warm amber */
    --warning-light: #fff2d6;
    --danger: #ff3e1d; /* Bold crimson */
    --danger-light: #ffe0db;
    --info: #03c3ec; /* Ocean cyan */
    --info-light: #d7f5fc;
    
    /* Layout Colors */
    --bg-main: #f5f5f9;
    --bg-card: #ffffff;
    --text-main: #566a7f;
    --text-heading: #384d6c;
    --text-muted: #697a8d;
    --border-color: #d9dee3;
    --sidebar-width: 260px;
    --sidebar-bg: #ffffff;
    --card-shadow: 0 0.25rem 1.125rem rgba(75, 70, 92, 0.05);
    --card-shadow-hover: 0 0.5rem 1.5rem rgba(75, 70, 92, 0.12);
}

/* Color Palette - Sneat Pro Dark */
html.dark-style {
    --bg-main: #232333;
    --bg-card: #2b2c40;
    --text-main: #a3a4db;
    --text-heading: #cbcbeb;
    --text-muted: #7071a4;
    --border-color: #444564;
    --sidebar-bg: #2b2c40;
    --card-shadow: 0 0.25rem 1.125rem rgba(15, 15, 30, 0.25);
    --card-shadow-hover: 0 0.5rem 1.8rem rgba(15, 15, 30, 0.35);

    /* Lighten base colors for contrast on dark */
    --primary-light: rgba(105, 108, 255, 0.16);
    --success-light: rgba(113, 221, 55, 0.16);
    --warning-light: rgba(255, 171, 0, 0.16);
    --danger-light: rgba(255, 62, 29, 0.16);
    --info-light: rgba(3, 195, 236, 0.16);
    --secondary-light: rgba(133, 146, 163, 0.16);
}

/* Bootstrap Utility Overrides for Dark Mode */
html.dark-style .bg-white { background-color: var(--bg-card) !important; }
html.dark-style .bg-light { background-color: rgba(255, 255, 255, 0.04) !important; }
html.dark-style .text-dark { color: var(--text-heading) !important; }
html.dark-style .text-muted { color: var(--text-muted) !important; }
html.dark-style .border-light { border-color: var(--border-color) !important; }
html.dark-style .card { background-color: var(--bg-card); border-color: var(--border-color); box-shadow: var(--card-shadow); }
html.dark-style .dropdown-menu { background-color: var(--bg-card); border-color: var(--border-color); box-shadow: var(--card-shadow); }
html.dark-style .dropdown-item { color: var(--text-main); }
html.dark-style .dropdown-item:hover { background-color: rgba(255, 255, 255, 0.05); color: var(--primary); }
html.dark-style .dropdown-divider { border-color: var(--border-color); }

/* Form Controls & Placeholders for Dark Mode */
html.dark-style .form-control,
html.dark-style .form-select,
html.dark-style .form-control:focus,
html.dark-style .form-select:focus {
    background-color: rgba(255, 255, 255, 0.03) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}
html.dark-style .form-control:focus,
html.dark-style .form-select:focus {
    background-color: var(--bg-card) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(105, 108, 255, 0.15) !important;
}
html.dark-style ::-webkit-input-placeholder { color: var(--text-muted) !important; opacity: 0.8 !important; }
html.dark-style ::-moz-placeholder { color: var(--text-muted) !important; opacity: 0.8 !important; }
html.dark-style :-ms-input-placeholder { color: var(--text-muted) !important; opacity: 0.8 !important; }
html.dark-style ::placeholder { color: var(--text-muted) !important; opacity: 0.8 !important; }

/* Invert Bootstrap close button and native date/time picker icons for Dark Mode */
html.dark-style .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
html.dark-style ::-webkit-calendar-picker-indicator { filter: invert(1); }
/* Global Transition Settings for Smooth Theme Toggles & Micro-interactions */
body, aside, header, main, .card-custom, table, td, th, a, input, select, textarea {
    transition: background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                color 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    font-size: 0.9375rem;
    line-height: 1.53;
}

/* Premium Webkit Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(105, 108, 255, 0.15);
    border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(105, 108, 255, 0.4);
}
html.dark-style ::-webkit-scrollbar-thumb {
    background: rgba(163, 164, 219, 0.15);
}
html.dark-style ::-webkit-scrollbar-thumb:hover {
    background: rgba(163, 164, 219, 0.4);
}

/* ==========================================================================
   VISUALS & ANIMATIONS (Lively Theme Animations)
   ========================================================================== */

/* SPA-Style Top Viewport Loader */
.top-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--info) 50%, var(--success) 100%);
    box-shadow: 0 0 10px rgba(105, 108, 255, 0.5), 0 0 5px rgba(3, 195, 236, 0.3);
    z-index: 9999;
    width: 0%;
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(1.5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(105, 108, 255, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(105, 108, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(105, 108, 255, 0); }
}

@keyframes bounceSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Clinical Status Badge Pulsing keyframes */
@keyframes pulseSuccess {
    0% { box-shadow: 0 0 0 0 rgba(113, 221, 55, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(113, 221, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(113, 221, 55, 0); }
}
@keyframes pulseWarning {
    0% { box-shadow: 0 0 0 0 rgba(255, 171, 0, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(255, 171, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 171, 0, 0); }
}
@keyframes pulseDanger {
    0% { box-shadow: 0 0 0 0 rgba(255, 62, 29, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(255, 62, 29, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 62, 29, 0); }
}
@keyframes pulsePrimary {
    0% { box-shadow: 0 0 0 0 rgba(105, 108, 255, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(105, 108, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(105, 108, 255, 0); }
}

/* Bell Shaking Ring Animation */
@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    10% { transform: rotate(18deg); }
    20% { transform: rotate(-18deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-14deg); }
    50% { transform: rotate(10deg); }
    60% { transform: rotate(-10deg); }
    70% { transform: rotate(6deg); }
    80% { transform: rotate(-6deg); }
    90% { transform: rotate(0); }
}

/* Snappy Modal Entry Zoom */
.modal.fade .modal-dialog {
    transform: scale(0.92) translateY(15px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
}

/* Interactive click button ripple effect */
.btn-ripple-container {
    position: relative;
    overflow: hidden;
}
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: rippleAnimation 0.65s ease-out;
    background-color: rgba(255, 255, 255, 0.35);
    pointer-events: none;
}
@keyframes rippleAnimation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Status Indicator Dots with Pulsing Glows */
.status-indicator-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}
.dot-success { background-color: var(--success); animation: pulseSuccess 2s infinite; }
.dot-warning { background-color: var(--warning); animation: pulseWarning 2s infinite; }
.dot-danger { background-color: var(--danger); animation: pulseDanger 2s infinite; }
.dot-primary { background-color: var(--primary); animation: pulsePrimary 2s infinite; }

/* CSS Classes for Animation deployment */
.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-slide-up {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-in-out both;
}

.animate-bounce-slow {
    animation: bounceSlow 2s ease-in-out infinite;
}

.pulse-glow {
    animation: pulseGlow 2s infinite;
}

.bell-ring-active {
    animation: bellRing 1.1s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.stagger-reveal {
    opacity: 0;
    transform: translateY(16px);
    animation: slideUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Delay modifiers for stagger effects */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* ==========================================================================
   SIDEBAR STYLING
   ========================================================================== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 15, 30, 0.4);
    backdrop-filter: blur(3px);
    z-index: 1029; /* Just below the sidebar which is 1030 */
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}
html.dark-style .sidebar-overlay {
    background-color: rgba(0, 0, 0, 0.6);
}

.app-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--sidebar-bg);
    box-shadow: 0 0.125rem 0.375rem 0 rgba(161, 172, 184, 0.08);
    border-right: 1px solid var(--border-color);
    z-index: 1040;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem 1.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 700;
    box-shadow: 0 3px 8px 0 rgba(105, 108, 255, 0.35);
    transition: all 0.3s;
}

.brand-icon:hover {
    transform: rotate(10deg) scale(1.05);
}

.brand-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 0 0.75rem;
    margin: 0.75rem 0;
    overflow-y: auto;
    flex: 1;
}

.menu-section {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #a1acb8;
    padding: 1.15rem 1rem 0.45rem;
    letter-spacing: 0.08em;
}

html.dark-style .menu-section {
    color: #63648f;
}

.menu-item {
    margin-bottom: 0.25rem;
}

/* Premium Locked Module Aesthetics */
.locked-module .menu-link {
    opacity: 0.55;
    filter: blur(0.7px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.locked-module:hover .menu-link {
    opacity: 1;
    filter: blur(0px);
    background-color: rgba(255, 171, 0, 0.08); /* Gold premium tint */
    color: var(--warning) !important;
}
.locked-module:hover .menu-link i:first-child {
    color: var(--warning);
}
.locked-module .menu-link::before {
    background-color: var(--warning);
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 1.15rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.92rem;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 4px;
    height: 50%;
    background-color: var(--primary);
    border-radius: 0 4px 4px 0;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-link:hover::before {
    transform: translateY(-50%) scaleY(1);
}

.menu-link:hover {
    background-color: rgba(105, 108, 255, 0.08);
    color: var(--primary);
    padding-left: 1.35rem; /* Delightful text shift animation */
}

.menu-link.active {
    background: linear-gradient(270deg, var(--primary), var(--primary-hover));
    color: white !important;
    font-weight: 600;
    box-shadow: 0 3px 10px 0 rgba(105, 108, 255, 0.35);
}

.menu-link.active::before {
    background-color: #ffffff;
    transform: translateY(-50%) scaleY(1);
    height: 35%;
}

.menu-link.active i {
    color: white !important;
}

.menu-link i {
    font-size: 1.2rem;
    width: 22px;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.menu-link:hover i {
    transform: scale(1.15) translateX(1px);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   APP MAIN & TOPBAR
   ========================================================================== */
.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.app-topbar {
    height: 70px;
    background-color: rgba(var(--bg-card === '#ffffff' ? '255, 255, 255' : '43, 44, 64'), 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
}

html.dark-style .app-topbar {
    background-color: rgba(43, 44, 64, 0.8);
}

.search-container {
    position: relative;
    width: 320px;
}

.search-input {
    background-color: var(--bg-main);
    border: 1px solid transparent;
    border-radius: 0.5rem;
    padding: 0.55rem 1rem 0.55rem 2.5rem;
    font-size: 0.9rem;
    width: 100%;
    color: var(--text-heading);
    transition: all 0.3s;
}

.search-input:focus {
    background-color: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(105, 108, 255, 0.15);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Global Search Dropdown */
.global-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 400px;
    max-height: 400px;
    overflow-y: auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    margin-top: 0.5rem;
    z-index: 1050;
}
.global-search-dropdown .search-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.75rem 1rem 0.25rem;
    letter-spacing: 0.05em;
}
.global-search-dropdown .search-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--border-color);
}
.global-search-dropdown .search-item:last-child {
    border-bottom: none;
}
.global-search-dropdown .search-item:hover {
    background-color: rgba(105, 108, 255, 0.05);
    color: var(--primary);
}
.global-search-dropdown .search-icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(105, 108, 255, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 0.9rem;
}
.global-search-dropdown .search-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
    display: block;
}
.global-search-dropdown .search-item-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}
@media (max-width: 767.98px) {
    .global-search-dropdown {
        width: 100%;
        max-width: 320px;
    }
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    background-color: transparent;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
    font-size: 1.25rem;
}

.action-btn:hover {
    background-color: rgba(105, 108, 255, 0.08);
    color: var(--primary);
    transform: translateY(-2px);
}

.nav-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--bg-card);
}

/* User Profile */
.user-profile-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.user-profile-box:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(105, 108, 255, 0.25);
}

/* ==========================================================================
   PREMIUM CARD WIDGETS
   ========================================================================== */
.card-custom {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                background-color 0.35s;
    position: relative;
    overflow: hidden;
}

.card-hover:hover {
    transform: translateY(-6px) scale(1.006);
    box-shadow: var(--card-shadow-hover), 0 12px 28px -5px rgba(105, 108, 255, 0.12);
    border-color: rgba(105, 108, 255, 0.3) !important;
}

/* Sneat Pro Welcome Banner Widget */
.welcome-hero-card {
    background: linear-gradient(135deg, rgba(105, 108, 255, 0.08) 0%, rgba(105, 108, 255, 0.01) 100%);
    border: 1px solid rgba(105, 108, 255, 0.15);
    border-radius: 0.75rem;
    position: relative;
}

html.dark-style .welcome-hero-card {
    background: linear-gradient(135deg, rgba(105, 108, 255, 0.15) 0%, rgba(105, 108, 255, 0.02) 100%);
    border-color: rgba(105, 108, 255, 0.25);
}

.welcome-illustration {
    position: absolute;
    right: 2rem;
    bottom: 0;
    height: 125px;
    z-index: 2;
    pointer-events: none;
}

/* Metric KPI Styling */
.avatar-box {
    width: 44px;
    height: 44px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.card-custom:hover .avatar-box {
    transform: scale(1.1) rotate(5deg);
}

.avatar-primary { background-color: var(--primary-light); color: var(--primary); }
.avatar-success { background-color: var(--success-light); color: var(--success); }
.avatar-warning { background-color: var(--warning-light); color: var(--warning); }
.avatar-danger { background-color: var(--danger-light); color: var(--danger); }
.avatar-info { background-color: var(--info-light); color: var(--info); }
.avatar-secondary { background-color: var(--secondary-light); color: var(--secondary); }

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
}

/* Quick Actions Button Bar */
.action-btn-custom {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.action-btn-custom:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
    color: var(--primary);
    transform: translateY(-1px);
}

.btn-primary-custom {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.55rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 3px 8px 0 rgba(105, 108, 255, 0.3);
}

.btn-primary-custom:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px 0 rgba(105, 108, 255, 0.4);
    color: white;
}

.btn-primary-custom:active, .action-btn:active, .action-btn-custom:active, .btn-outline-primary:active, .btn-outline-success:active, .btn-outline-secondary:active, .btn-light:active {
    transform: scale(0.96) translateY(0) !important;
    transition: transform 0.08s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Sleek Tables */
.table-responsive {
    border-radius: 0.5rem;
}
.table {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: var(--text-main);
    border-color: var(--border-color);
}
.table th {
    background-color: rgba(105, 108, 255, 0.03);
    color: var(--text-heading);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 1.1rem 1.25rem;
    border-bottom: 2px solid var(--border-color);
}
html.dark-style .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-main);
    color: var(--text-main);
}
html.dark-style .table td,
html.dark-style .table th {
    background-color: transparent !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}
html.dark-style .table th {
    background-color: rgba(163, 164, 219, 0.03) !important;
    color: var(--text-heading) !important;
}
.table td {
    padding: 1.1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}
.table tbody tr {
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.table tbody tr:hover {
    background-color: rgba(105, 108, 255, 0.04) !important;
    transform: scale(1.002) translateX(3px);
    box-shadow: 0 4px 12px -3px rgba(105, 108, 255, 0.08);
}

/* Badge System - Pill Design */
.badge-custom {
    padding: 0.35rem 0.75rem;
    border-radius: 50rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.badge-purple { background-color: var(--primary-light); color: var(--primary); }
.badge-success { background-color: var(--success-light); color: var(--success); }
.badge-warning { background-color: var(--warning-light); color: var(--warning); }
.badge-danger { background-color: var(--danger-light); color: var(--danger); }
.badge-indigo { background-color: rgba(99, 102, 241, 0.15); color: #6366f1; }
.badge-info { background-color: var(--info-light); color: var(--info); }
.badge-secondary { background-color: var(--secondary-light); color: var(--secondary); }

/* Form Controls & Select Inputs */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    color: var(--text-heading);
    background-color: var(--bg-card);
    transition: all 0.25s;
}
html.dark-style .form-control, html.dark-style .form-select {
    background-color: #2b2c40;
    border-color: #444564;
    color: #cbcbeb;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(105, 108, 255, 0.15);
    background-color: var(--bg-card);
    color: var(--text-heading);
}

/* Modals */
.modal-content {
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 0.5rem 2rem rgba(15, 15, 30, 0.15);
    background-color: var(--bg-card);
}
.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}
.modal-body {
    padding: 1.5rem;
}
.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

/* Dynamic Notification Toast */
.toast-container {
    z-index: 1090;
}
.toast {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 0.5rem 1.5rem rgba(15, 15, 30, 0.18);
    background-color: var(--bg-card);
}

/* ==========================================================================
   DARK STYLE EXTRA OVERRIDES (Bootstrap cleanup)
   ========================================================================== */
html.dark-style .text-dark {
    color: #cbcbeb !important;
}
html.dark-style .bg-white {
    background-color: #2b2c40 !important;
}
html.dark-style .border {
    border-color: #444564 !important;
}
html.dark-style .bg-light, html.dark-style .modal-header, html.dark-style .modal-footer {
    background-color: #232333 !important;
}
html.dark-style .btn-light {
    background-color: #35364e;
    color: #a3a4db;
    border-color: #444564;
}
html.dark-style .btn-light:hover {
    background-color: #414261;
}
html.dark-style hr {
    border-color: #444564;
    opacity: 0.5;
}
html.dark-style .dropdown-menu {
    background-color: #2b2c40;
    border: 1px solid #444564 !important;
}
html.dark-style .dropdown-item {
    color: #a3a4db;
}
html.dark-style .dropdown-item:hover {
    background-color: rgba(105, 108, 255, 0.08);
    color: #696cff;
}
html.dark-style .dropdown-divider {
    border-color: #444564;
}

.page-content {
    padding: 2.25rem 2.25rem 3.5rem 2.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================== */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0,0,0,0.25);
    }
    .app-main {
        margin-left: 0;
    }
    .app-topbar {
        padding: 0 1rem;
    }
    .page-content {
        padding: 1.5rem 1rem;
    }
    .search-container {
        width: 160px;
    }
}
@media (max-width: 575.98px) {
    .app-topbar {
        padding: 0 0.5rem;
    }
    .search-container {
        width: 100px;
    }
    .search-input {
        padding-left: 1.8rem;
        padding-right: 0.5rem;
        font-size: 0.75rem;
    }
    .search-input::placeholder {
        color: transparent;
    }
    .search-icon {
        left: 0.5rem;
        cursor: pointer;
    }
    .topbar-actions {
        gap: 0.25rem;
    }
    /* Reduce profile email text on mobile */
    .profile-email-text {
        font-size: 0.60rem !important;
    }
}

/* Mobile-specific profile dropdown email styling for tablets */
@media (max-width: 767.98px) and (min-width: 576px) {
    .profile-email-text {
        font-size: 0.65rem !important;
    }
}

/* Mobile Search Modal Styling */
.search-container-modal {
    position: relative;
}

.search-container-modal .search-icon {
    left: 1.85rem;
}

.search-input-modal {
    padding-left: 2.5rem !important;
    padding: 0.75rem 1rem 0.75rem 2.5rem !important;
    font-size: 1rem;
    border: 1px solid var(--border-color) !important;
    border-radius: 0.5rem;
}

.search-input-modal:focus {
    background-color: var(--bg-card) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(105, 108, 255, 0.15) !important;
}

.search-input-modal::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.8 !important;
}

/* Show modal search on small screens, hide desktop dropdown */
@media (max-width: 575.98px) {
    .global-search-dropdown {
        display: none !important;
    }
}

/* Mobile Search Modal */
#mobileSearchModal .modal-header {
    padding: 1rem 1.5rem;
    background-color: var(--bg-main);
}

#mobileSearchModal .modal-content {
    background-color: var(--bg-card);
}

#mobileSearchModal .modal-body {
    background-color: var(--bg-main);
}

.search-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.75rem 1rem 0.25rem;
    letter-spacing: 0.05em;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background-color: rgba(105, 108, 255, 0.05);
    color: var(--primary);
}

.search-icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(105, 108, 255, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.search-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
    display: block;
}

.search-item-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}
