:root {
    --primary: #15803d;
    --primary-dark: #166534;
    --primary-light: #22c55e;
    --primary-subtle: #dcfce7;
    --bg-body: #f6faf7;
    --bg-card: rgba(255, 255, 255, 0.94);
    --bg-sidebar: #0f2d1e;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.08);
    --bg-sidebar-active: #15803d;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border-color: rgba(187, 247, 208, 0.65);
    --border-glass: rgba(255, 255, 255, 0.7);
    --border-focus: #15803d;
    --status-active-bg: #e8f5e9;
    --status-active-text: #1b5e20;
    --status-active-border: #a5d6a7;
    --status-locked-bg: #eceff1;
    --status-locked-text: #37474f;
    --status-locked-border: #b0bec5;
    --status-warning-bg: #fff3e0;
    --status-warning-text: #b76e00;
    --status-warning-border: #ffe082;
    --status-danger-bg: #ffebee;
    --status-danger-text: #c62828;
    --status-danger-border: #ef9a9a;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --shadow-sm: 0 1px 3px rgba(22, 101, 52, 0.04), 0 1px 2px rgba(22, 101, 52, 0.02);
    --shadow-md: 0 4px 16px -2px rgba(22, 101, 52, 0.06), 0 2px 6px -1px rgba(22, 101, 52, 0.03);
    --shadow-lg: 0 12px 28px -4px rgba(22, 101, 52, 0.08), 0 4px 12px -2px rgba(22, 101, 52, 0.04);
    --shadow-glass: 0 8px 32px 0 rgba(22, 101, 52, 0.06);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-base: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-base);
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-primary);
    background: radial-gradient(circle at 12% 15%, rgba(34, 197, 94, 0.09) 0%, transparent 45%),
        radial-gradient(circle at 88% 85%, rgba(16, 185, 129, 0.07) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(240, 253, 244, 0.5) 0%, transparent 60%),
        #f6faf7;
    background-attachment: fixed;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.1px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    position: relative;
    user-select: none;
}

/* Collapsed State */
.app-sidebar.collapsed {
    width: 80px;
}

/* Sidebar Brand / Header */
.sidebar-brand {
    height: 70px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    min-width: 0;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(22, 101, 52, 0.35);
}

.brand-text {
    opacity: 1;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.app-sidebar.collapsed .sidebar-brand {
    padding: 0;
    justify-content: center;
    align-items: center;
}

.app-sidebar.collapsed .brand-logo {
    display: none !important;
}

.app-sidebar.collapsed .sidebar-toggle-btn {
    position: static;
    transform: none;
    width: 42px;
    height: 42px;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.app-sidebar.collapsed .sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(34, 197, 94, 0.5);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

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

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

/* Group Title */
.nav-group-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
    padding: 16px 12px 6px;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.app-sidebar.collapsed .nav-group-title {
    height: 1px;
    margin: 12px 8px;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.08);
    font-size: 0;
    overflow: hidden;
}

/* Sidebar Menu & Items */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 4px 0;
}

.sidebar-item {
    margin-bottom: 3px;
    position: relative;
}

/* Collapsible Folder / Dropdown Menu in Sidebar */
.sidebar-folder {
    margin-bottom: 4px;
    position: relative;
}

.sidebar-folder-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    color: #e2e8f0;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    user-select: none;
}

.sidebar-folder-toggle .folder-left {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
}

.sidebar-folder-toggle .folder-left span {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.sidebar-folder-toggle .folder-left i {
    font-size: 19px;
    width: 22px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.sidebar-folder-toggle .folder-chevron {
    font-size: 12px;
    color: #64748b;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
    margin-left: 6px;
    flex-shrink: 0;
}

.sidebar-folder-toggle:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-folder-toggle:hover .folder-left i,
.sidebar-folder-toggle:hover .folder-chevron {
    color: #ffffff;
}

.sidebar-folder.open>.sidebar-folder-toggle {
    color: #ffffff;
}

.sidebar-folder.open>.sidebar-folder-toggle .folder-chevron {
    transform: rotate(180deg);
    color: var(--primary-light);
}

.sidebar-folder.active-group>.sidebar-folder-toggle {
    color: #ffffff;
    font-weight: 600;
}

.sidebar-folder.active-group>.sidebar-folder-toggle .folder-left i {
    color: var(--primary-light);
}

/* Submenu */
.sidebar-submenu {
    list-style: none;
    padding: 3px 0 3px 10px;
    margin: 2px 0 6px 10px;
    border-left: 2px solid rgba(255, 255, 255, 0.12);
    display: none;
    transition: all 0.25s ease;
}

.sidebar-folder.open>.sidebar-submenu {
    display: block;
}

.sidebar-submenu .sidebar-link {
    padding: 8px 10px;
    font-size: 13px;
    color: #cbd5e1;
    border-radius: var(--radius-sm);
    gap: 9px;
    border-left: none;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}

.sidebar-submenu .sidebar-link span {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.sidebar-submenu .sidebar-link i {
    font-size: 15px;
    width: 18px;
    color: #64748b;
    flex-shrink: 0;
}

.sidebar-submenu .sidebar-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-submenu .sidebar-link:hover i {
    color: #ffffff;
}

.sidebar-submenu .sidebar-link.active {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(22, 101, 52, 0.35);
}

.sidebar-submenu .sidebar-link.active i {
    color: #ffffff;
}

/* In Collapsed Sidebar (80px) */
.app-sidebar.collapsed .sidebar-folder-toggle {
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 4px auto;
    border-radius: 10px;
    position: relative;
}

.app-sidebar.collapsed .sidebar-folder-toggle span,
.app-sidebar.collapsed .sidebar-folder-toggle .folder-chevron {
    display: none !important;
}

.app-sidebar.collapsed .sidebar-folder.active-group>.sidebar-folder-toggle {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.app-sidebar.collapsed .sidebar-folder.active-group>.sidebar-folder-toggle .folder-left i {
    color: var(--primary-light);
}

/* Collapsed Flyout Submenu Popover on Hover */
.app-sidebar.collapsed .sidebar-folder {
    position: relative;
}

.app-sidebar.collapsed .sidebar-folder .sidebar-submenu {
    position: absolute;
    left: calc(100% + 12px);
    top: 0;
    width: 220px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    padding: 8px;
    margin: 0;
    z-index: 1300;
    display: none;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.app-sidebar.collapsed .sidebar-folder:hover .sidebar-submenu {
    display: block;
}

.app-sidebar.collapsed .sidebar-submenu .sidebar-link {
    justify-content: flex-start;
    padding: 8px 12px;
    width: 100%;
    height: auto;
    margin: 2px 0;
}

.app-sidebar.collapsed .sidebar-submenu .sidebar-link span {
    display: inline-block !important;
}

.app-sidebar.collapsed .sidebar-submenu .sidebar-link::after,
.app-sidebar.collapsed .sidebar-submenu .sidebar-link::before {
    display: none !important;
}

/* Sidebar Links */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
    position: relative;
    border-left: 3px solid transparent;
}

.sidebar-link span {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.sidebar-link i {
    font-size: 19px;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-link:hover i {
    color: #ffffff;
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.25) 0%, rgba(34, 197, 94, 0.08) 100%);
    color: #ffffff;
    font-weight: 600;
    border-left: 3px solid #22c55e;
}

.sidebar-link.active i {
    color: var(--primary-light);
}

/* Collapsed Links & Floating Tooltips */
.app-sidebar.collapsed .sidebar-nav {
    padding: 16px 8px;
}

.app-sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 11px 0;
    width: 48px;
    height: 48px;
    margin: 4px auto;
    border-radius: 10px;
    border-left: none;
}

.app-sidebar.collapsed .sidebar-link.active {
    background: linear-gradient(135deg, #16a34a, #15803d);
    box-shadow: 0 4px 12px rgba(22, 101, 52, 0.4);
}

.app-sidebar.collapsed .sidebar-link.active i {
    color: #ffffff;
}

.app-sidebar.collapsed .sidebar-link span {
    display: none !important;
}

/* CSS Floating Tooltip for Collapsed Sidebar */
.app-sidebar.collapsed .sidebar-link::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    color: #f8fafc;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.app-sidebar.collapsed .sidebar-link::before {
    content: '';
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #0f172a;
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.app-sidebar.collapsed .sidebar-link:hover::after,
.app-sidebar.collapsed .sidebar-link:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(0, 0, 0, 0.1);
}

.app-sidebar.collapsed .sidebar-footer {
    padding: 12px 8px;
}

.app-sidebar.collapsed .sidebar-footer .sidebar-link {
    width: 48px;
    height: 48px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.app-sidebar.collapsed .sidebar-footer .sidebar-link span {
    display: none !important;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: transparent;
}

.app-header {
    height: 70px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(187, 247, 208, 0.55);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 2px 14px rgba(22, 101, 52, 0.04);
}

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

.header-search {
    position: relative;
    width: 280px;
}

.header-search input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    font-size: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.8);
    outline: none;
    transition: var(--transition);
}

.header-search input:focus {
    border-color: var(--border-focus);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.header-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

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

.header-action-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.header-action-btn:hover {
    background-color: #ffffff;
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.header-badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: #e53935;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #ffffff;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 5px rgba(229, 57, 53, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(229, 57, 53, 0);
    }
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.user-profile-menu:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-subtle);
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* App Content Animation */
@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

.app-content {
    flex: 1;
    padding: 26px 28px;
    animation: fadeInContent 0.35s ease-out;
    position: relative;
    overflow: hidden;
}

.app-content>*:not(.bg-bubble-container) {
    position: relative;
    z-index: 1;
}

/* Eco Floating Glass Bubbles Background */
.bg-bubble-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-bubble {
    position: absolute;
    bottom: -20px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, rgba(34, 197, 94, 0.6) 60%, rgba(16, 185, 129, 0.8) 100%);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5), 0 0 2px rgba(255, 255, 255, 0.8);
    pointer-events: none;
    opacity: 0;
}

.b-1 {
    width: 6px;
    height: 6px;
    left: 4%;
    animation: bubbleRiseA 16s linear infinite;
    animation-delay: -2s;
}

.b-2 {
    width: 5px;
    height: 5px;
    left: 10%;
    animation: bubbleRiseB 14s linear infinite;
    animation-delay: -8s;
}

.b-3 {
    width: 7px;
    height: 7px;
    left: 16%;
    animation: bubbleRiseC 19s linear infinite;
    animation-delay: -12s;
}

.b-4 {
    width: 4px;
    height: 4px;
    left: 22%;
    animation: bubbleRiseA 13s linear infinite;
    animation-delay: -5s;
}

.b-5 {
    width: 6px;
    height: 6px;
    left: 28%;
    animation: bubbleRiseB 17s linear infinite;
    animation-delay: -15s;
}

.b-6 {
    width: 5px;
    height: 5px;
    left: 34%;
    animation: bubbleRiseC 15s linear infinite;
    animation-delay: -3s;
}

.b-7 {
    width: 8px;
    height: 8px;
    left: 40%;
    animation: bubbleRiseA 21s linear infinite;
    animation-delay: -9s;
}

.b-8 {
    width: 5px;
    height: 5px;
    left: 46%;
    animation: bubbleRiseB 14s linear infinite;
    animation-delay: -1s;
}

.b-9 {
    width: 4px;
    height: 4px;
    left: 52%;
    animation: bubbleRiseC 12s linear infinite;
    animation-delay: -7s;
}

.b-10 {
    width: 7px;
    height: 7px;
    left: 58%;
    animation: bubbleRiseA 18s linear infinite;
    animation-delay: -14s;
}

.b-11 {
    width: 5px;
    height: 5px;
    left: 64%;
    animation: bubbleRiseB 15s linear infinite;
    animation-delay: -4s;
}

.b-12 {
    width: 6px;
    height: 6px;
    left: 70%;
    animation: bubbleRiseC 16s linear infinite;
    animation-delay: -11s;
}

.b-13 {
    width: 8px;
    height: 8px;
    left: 76%;
    animation: bubbleRiseA 20s linear infinite;
    animation-delay: -6s;
}

.b-14 {
    width: 5px;
    height: 5px;
    left: 82%;
    animation: bubbleRiseB 13s linear infinite;
    animation-delay: -10s;
}

.b-15 {
    width: 4px;
    height: 4px;
    left: 88%;
    animation: bubbleRiseC 12s linear infinite;
    animation-delay: -2s;
}

.b-16 {
    width: 6px;
    height: 6px;
    left: 93%;
    animation: bubbleRiseA 17s linear infinite;
    animation-delay: -16s;
}

.b-17 {
    width: 5px;
    height: 5px;
    left: 7%;
    animation: bubbleRiseB 15s linear infinite;
    animation-delay: -13s;
}

.b-18 {
    width: 7px;
    height: 7px;
    left: 25%;
    animation: bubbleRiseC 18s linear infinite;
    animation-delay: -7s;
}

.b-19 {
    width: 5px;
    height: 5px;
    left: 60%;
    animation: bubbleRiseA 14s linear infinite;
    animation-delay: -11s;
}

.b-20 {
    width: 6px;
    height: 6px;
    left: 85%;
    animation: bubbleRiseB 16s linear infinite;
    animation-delay: -3s;
}

@keyframes bubbleRiseA {
    0% {
        transform: translateY(0) translateX(0) scale(0.7);
        opacity: 0;
    }

    8% {
        opacity: 0.8;
    }

    35% {
        transform: translateY(-38vh) translateX(18px) scale(1.1);
    }

    65% {
        transform: translateY(-72vh) translateX(-14px) scale(0.95);
        opacity: 0.75;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-112vh) translateX(12px) scale(0.7);
        opacity: 0;
    }
}

@keyframes bubbleRiseB {
    0% {
        transform: translateY(0) translateX(0) scale(0.65);
        opacity: 0;
    }

    10% {
        opacity: 0.85;
    }

    40% {
        transform: translateY(-45vh) translateX(-22px) scale(1.2);
    }

    75% {
        transform: translateY(-80vh) translateX(16px) scale(0.9);
        opacity: 0.7;
    }

    92% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(-112vh) translateX(-10px) scale(0.75);
        opacity: 0;
    }
}

@keyframes bubbleRiseC {
    0% {
        transform: translateY(0) translateX(0) scale(0.8);
        opacity: 0;
    }

    12% {
        opacity: 0.9;
    }

    45% {
        transform: translateY(-50vh) translateX(24px) scale(1.15);
    }

    70% {
        transform: translateY(-78vh) translateX(-20px) scale(0.85);
        opacity: 0.7;
    }

    90% {
        opacity: 0.55;
    }

    100% {
        transform: translateY(-112vh) translateX(8px) scale(0.65);
        opacity: 0;
    }
}

.page-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 6px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.breadcrumb-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(187, 247, 208, 0.75);
    border-radius: 20px;
    padding: 5px 14px;
    box-shadow: 0 1px 4px rgba(22, 101, 52, 0.04);
    width: fit-content;
}

.breadcrumb-nav a {
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease;
    text-decoration: none;
}

.breadcrumb-nav a:hover {
    color: var(--primary);
}

.breadcrumb-nav span {
    color: #94a3b8;
}

.breadcrumb-nav span.text-primary,
.breadcrumb-nav .active {
    color: var(--primary) !important;
    font-weight: 600;
}

/* Glassmorphic Card */
.card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(187, 247, 208, 0.65);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px -2px rgba(22, 101, 52, 0.05), 0 2px 6px -1px rgba(22, 101, 52, 0.02);
    margin-bottom: 24px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 36px -4px rgba(22, 101, 52, 0.12), 0 6px 14px -2px rgba(22, 101, 52, 0.04);
    border-color: rgba(34, 197, 94, 0.45);
}

.card-header {
    padding: 16px 22px;
    background: rgba(255, 255, 255, 0.75);
    border-bottom: 1px solid rgba(187, 247, 208, 0.45);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 22px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.btn-primary,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.show>.btn-primary.dropdown-toggle {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    border-color: #15803d !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(22, 101, 52, 0.25) !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #15803d, #166534) !important;
    border-color: #166534 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(22, 101, 52, 0.35) !important;
}

.btn-outline-primary {
    color: #15803d !important;
    border-color: #15803d !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-outline-primary:focus {
    background-color: #15803d !important;
    border-color: #15803d !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(22, 101, 52, 0.25) !important;
}

.btn-check:checked+.btn-outline-primary,
.btn-check:checked+.btn-primary {
    background-color: #15803d !important;
    border-color: #15803d !important;
    color: #ffffff !important;
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: translateY(-1px);
}

/* Global Bootstrap Theme Component Overrides */
.text-primary,
.link-primary {
    color: var(--primary) !important;
}

.link-primary:hover,
.link-primary:focus {
    color: var(--primary-dark) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.bg-primary-subtle {
    background-color: var(--primary-subtle) !important;
    color: var(--primary-dark) !important;
}

.border-primary {
    border-color: var(--primary) !important;
}

.border-primary-subtle {
    border-color: #bbf7d0 !important;
}

/* Tabs & Nav Pills */
.nav-pills .nav-link {
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-pills .nav-link:hover {
    color: var(--primary);
    background-color: rgba(34, 197, 94, 0.08);
}

.nav-pills .nav-link.active,
.nav-pills .show>.nav-link {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(22, 101, 52, 0.25) !important;
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    border-color: transparent transparent var(--border-color);
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: var(--primary) !important;
    border-color: var(--border-color) var(--border-color) #ffffff !important;
    background-color: #ffffff !important;
    font-weight: 600;
}

/* Form Controls, Inputs & Focus */
.form-control:focus,
.form-select:focus {
    border-color: #86efac !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18) !important;
}

.form-check-input:checked {
    background-color: #15803d !important;
    border-color: #15803d !important;
}

.form-check-input:focus {
    border-color: #86efac !important;
    box-shadow: 0 0 0 0.25rem rgba(22, 163, 74, 0.2) !important;
}

.form-range::-webkit-slider-thumb {
    background-color: #15803d !important;
}

.form-range::-moz-range-thumb {
    background-color: #15803d !important;
}

/* Pagination */
nav p.small.text-muted,
nav .d-none.flex-sm-fill>div:first-child {
    display: none !important;
}

.page-item.active .page-link {
    background-color: #15803d !important;
    border-color: #15803d !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(22, 101, 52, 0.25) !important;
}

.page-link {
    color: #15803d !important;
    border-color: rgba(187, 247, 208, 0.8) !important;
}

.page-link:hover {
    color: #166534 !important;
    background-color: #dcfce7 !important;
    border-color: #86efac !important;
}

.page-link:focus {
    box-shadow: 0 0 0 0.25rem rgba(22, 163, 74, 0.2) !important;
}

/* Dropdowns & Progress */
.dropdown-item.active,
.dropdown-item:active {
    background-color: #15803d !important;
    color: #ffffff !important;
}

.progress-bar {
    background-color: #15803d !important;
}

/* Table styling */
.app-table {
    width: 100%;
    border-collapse: collapse;
}

.app-table tbody tr {
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn-danger {
    background-color: var(--status-danger-text);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #b71c1c;
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-warning {
    background-color: #f59e0b;
    color: #ffffff;
}

.btn-warning:hover {
    background-color: #d97706;
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-danger:hover {
    background-color: #b71c1c;
    color: #ffffff;
}

.btn-warning {
    background-color: #f59e0b;
    color: #ffffff;
}

.btn-warning:hover {
    background-color: #d97706;
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control,
.form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(42, 87, 126, 0.15);
}

.form-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.custom-table th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 14px 18px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.custom-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.custom-table tbody tr {
    transition: var(--transition);
}

.custom-table tbody tr:hover {
    background-color: #f8fafc;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
}

.badge-active {
    background-color: var(--status-active-bg);
    color: var(--status-active-text);
    border-color: var(--status-active-border);
}

.badge-locked {
    background-color: var(--status-locked-bg);
    color: var(--status-locked-text);
    border-color: var(--status-locked-border);
}

.badge-role {
    background-color: var(--primary-subtle);
    color: var(--primary);
    border-color: #c7d9ec;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(at top left, rgba(30, 90, 138, 0.45) 0%, transparent 60%),
        radial-gradient(at bottom right, rgba(15, 30, 46, 0.95) 0%, transparent 60%),
        #0f1e2e;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
    padding: 38px 34px;
    animation: fadeInContent 0.4s ease-out;
}

.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}

.auth-brand .brand-icon {
    width: 56px;
    height: 56px;
    font-size: 26px;
    margin: 0 auto 14px;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.auth-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.avatar-preview-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 16px;
}

.avatar-preview-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-subtle);
    box-shadow: var(--shadow-md);
}

.avatar-upload-label {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 34px;
    height: 34px;
    background-color: var(--primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.avatar-upload-label:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

.app-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    isolation: isolate;
}

.app-modal.show {
    display: flex !important;
}

.app-modal .modal-dialog {
    width: 100%;
    max-width: 540px;
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto !important;
    margin: 0 !important;
    position: relative !important;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

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

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--bg-body);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.empty-state-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast-item {
    min-width: 320px;
    background-color: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s ease;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

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

/* ==========================================
   Dark Theme (Chế độ Tối)
   ========================================== */
html[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.95);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: rgba(51, 65, 85, 0.8);
    --border-glass: rgba(51, 65, 85, 0.6);
    --status-active-bg: rgba(22, 101, 52, 0.3);
    --status-active-text: #4ade80;
    --status-active-border: #166534;
}

html[data-theme="dark"] body {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .app-header,
html[data-theme="dark"] .app-footer,
html[data-theme="dark"] .app-modal .modal-dialog,
html[data-theme="dark"] .page-header {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .page-header-title h1 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .custom-table th {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .custom-table td {
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}