:root {
    --primary-black: #1a1a2e;
    --primary-dark: #16213e;
    --primary-gradient: linear-gradient(135deg, #0f0f23 0%, #2d2d44 100%);
    --secondary-white: #ffffff;
    --accent-gray: #808080;
    --accent-gold: #d4af37;
    --accent-gold-light: #f0d060;
    --accent-gold-dark: #b8960c;
    --bg-light: #f4f6f9;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --text-light: #adb5bd;
    --border-color: #e9ecef;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
    --shadow-gold: 0 4px 20px rgba(212,175,55,0.25);
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 65px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ===== PAGE LOAD ANIMATION ===== */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.page-loader .loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.page-loader .loader-text {
    color: var(--accent-gold);
    margin-top: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    animation: loaderPulse 1.5s ease-in-out infinite;
}

/* ===== CONTENT FADE-IN ===== */
.main-content {
    animation: fadeInUp 0.5s ease-out;
}

/* ===== KEYFRAMES ===== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes loaderPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

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

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

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(212,175,55,0.3); }
    50% { box-shadow: 0 0 20px rgba(212,175,55,0.5); }
}

@keyframes borderGlow {
    0%, 100% { border-color: var(--accent-gold); }
    50% { border-color: var(--accent-gold-light); }
}

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

@keyframes ripple {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary-gradient);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.15);
}

.brand-logo {
    color: var(--accent-gold);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.brand-logo:hover {
    text-shadow: 0 0 20px rgba(212,175,55,0.5);
}

.brand-logo i {
    font-size: 1.8rem;
    animation: float 3s ease-in-out infinite;
}

.sidebar-nav {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.sidebar-nav li {
    animation: slideInLeft 0.3s ease-out both;
}
.sidebar-nav li:nth-child(1) { animation-delay: 0.05s; }
.sidebar-nav li:nth-child(2) { animation-delay: 0.1s; }
.sidebar-nav li:nth-child(3) { animation-delay: 0.15s; }
.sidebar-nav li:nth-child(4) { animation-delay: 0.2s; }
.sidebar-nav li:nth-child(5) { animation-delay: 0.25s; }
.sidebar-nav li:nth-child(6) { animation-delay: 0.3s; }
.sidebar-nav li:nth-child(7) { animation-delay: 0.35s; }
.sidebar-nav li:nth-child(8) { animation-delay: 0.4s; }
.sidebar-nav li:nth-child(9) { animation-delay: 0.45s; }
.sidebar-nav li:nth-child(10) { animation-delay: 0.5s; }

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
    gap: 12px;
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.sidebar-nav li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(212,175,55,0.1), transparent);
    transition: width 0.4s ease;
    z-index: 0;
}

.sidebar-nav li a:hover::before {
    width: 100%;
}

.sidebar-nav li a i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    position: relative;
    z-index: 1;
    transition: var(--transition-bounce);
}

.sidebar-nav li a span {
    position: relative;
    z-index: 1;
}

.sidebar-nav li a:hover,
.sidebar-nav li.active a {
    color: #fff;
    background: rgba(212,175,55,0.15);
    border-left-color: var(--accent-gold);
}

.sidebar-nav li a:hover i,
.sidebar-nav li.active a i {
    color: var(--accent-gold);
    transform: scale(1.15);
}

.chat-badge {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    animation: glowPulse 2s infinite;
}

/* ===== CONTENT AREA ===== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: var(--transition);
}

/* ===== TOPBAR ===== */
.topbar {
    height: var(--topbar-height);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.topbar .btn-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.2rem;
    padding: 8px;
    transition: var(--transition);
}

.topbar .btn-link:hover {
    color: var(--accent-gold);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 50%;
    animation: glowPulse 2s infinite;
}

.notification-dropdown {
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    border: none;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.2s ease-out;
}

.main-content {
    padding: 24px;
}

/* ===== USER AVATAR ===== */
.user-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 0 0 2px rgba(212,175,55,0.2);
}

.user-avatar-sm:hover {
    box-shadow: 0 0 0 3px rgba(212,175,55,0.4);
    transform: scale(1.05);
}

.user-avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initials {
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold-dark), var(--accent-gold), var(--accent-gold-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 600;
    position: relative;
}

/* ===== STAT CARDS ===== */
.stat-card {
    border-radius: 16px;
    padding: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: var(--transition-bounce);
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.stat-card:hover::after {
    width: 140px;
    height: 140px;
    top: -50px;
    right: -50px;
}

.stat-card::before {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -20px;
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
    margin-bottom: 12px;
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(-5deg);
    opacity: 1;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

.stat-card.bg-gold-gradient {
    background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold), var(--accent-gold-light));
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

.stat-card.bg-dark-gradient {
    background: linear-gradient(135deg, #0f0f23, #1a1a2e, #2d2d44);
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

.stat-card.bg-gray-gradient {
    background: linear-gradient(135deg, #343a40, #495057, #6c757d);
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}

.stat-card.bg-success-gradient {
    background: linear-gradient(135deg, #0d6e3a, #198754, #20c997);
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

.stat-card.bg-info-gradient {
    background: linear-gradient(135deg, #0a5c8a, #0dcaf0, #48c6ef);
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

.stat-card.bg-danger-gradient {
    background: linear-gradient(135deg, #8b0000, #dc3545, #ff6b6b);
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

.stat-card.bg-purple-gradient {
    background: linear-gradient(135deg, #4a148c, #7b1fa2, #ab47bc);
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

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

.table thead th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid var(--accent-gold);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 12px 16px;
}

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

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

.table tbody tr:hover {
    background: linear-gradient(90deg, rgba(212,175,55,0.03), rgba(212,175,55,0.08), rgba(212,175,55,0.03));
}

.table tbody tr:hover td {
    border-bottom-color: var(--accent-gold);
}

/* ===== BUTTONS ===== */
.btn-gold {
    background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold));
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.btn-gold::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212,175,55,0.4);
}

.btn-gold:hover::after {
    width: 300px;
    height: 300px;
}

.btn-gold:active {
    transform: translateY(0);
}

.btn-outline-gold {
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    background: transparent;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.btn-outline-gold::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.15), transparent);
    transition: left 0.5s ease;
}

.btn-outline-gold:hover {
    background: var(--accent-gold);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212,175,55,0.3);
}

.btn-outline-gold:hover::before {
    left: 100%;
}

.bg-gold { background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold)) !important; }
.text-gold { color: var(--accent-gold) !important; }
.border-gold { border-color: var(--accent-gold) !important; }

/* ===== BADGES ===== */
.badge-gold {
    background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold));
    color: #fff;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
}

.badge-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}

.badge-status:hover {
    transform: scale(1.05);
}

.badge-open { background: linear-gradient(135deg, #ffeaa7, #fdcb6e); color: #6c5300; }
.badge-in-review { background: linear-gradient(135deg, #74b9ff, #0984e3); color: #fff; }
.badge-approved { background: linear-gradient(135deg, #55efc4, #00b894); color: #004d33; }
.badge-resolved { background: linear-gradient(135deg, #81ecec, #00cec9); color: #004d4c; }
.badge-rejected { background: linear-gradient(135deg, #fab1a0, #e17055); color: #fff; }
.badge-closed { background: linear-gradient(135deg, #dfe6e9, #b2bec3); color: #2d3436; }
.badge-paid { background: linear-gradient(135deg, #55efc4, #00b894); color: #004d33; }
.badge-unpaid { background: linear-gradient(135deg, #ffeaa7, #fdcb6e); color: #6c5300; }
.badge-overdue { background: linear-gradient(135deg, #fab1a0, #e17055); color: #fff; }
.badge-draft { background: linear-gradient(135deg, #dfe6e9, #b2bec3); color: #2d3436; }
.badge-cancelled { background: linear-gradient(135deg, #fab1a0, #e17055); color: #fff; }
.badge-low { background: linear-gradient(135deg, #55efc4, #00b894); color: #004d33; }
.badge-medium { background: linear-gradient(135deg, #ffeaa7, #fdcb6e); color: #6c5300; }
.badge-high { background: linear-gradient(135deg, #ffeaa7, #fdcb6e); color: #6c5300; }
.badge-urgent { background: linear-gradient(135deg, #ff7675, #d63031); color: #fff; animation: glowPulse 2s infinite; }

/* Priority indicators */
.priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    transition: var(--transition);
}
.priority-low { background: linear-gradient(135deg, #00b894, #55efc4); }
.priority-medium { background: linear-gradient(135deg, #fdcb6e, #ffeaa7); }
.priority-high { background: linear-gradient(135deg, #e17055, #fab1a0); }
.priority-urgent { background: linear-gradient(135deg, #d63031, #ff7675); animation: pulse 1.5s infinite; box-shadow: 0 0 8px rgba(214,48,49,0.5); }

/* ===== FORMS ===== */
.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.input-group-text {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: var(--transition);
}

.input-group:focus-within .input-group-text {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(-45deg, #0f0f23, #1a1a2e, #2d2d44, #16213e);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(212,175,55,0.08), transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(212,175,55,0.06), transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

.login-card {
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 480px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    animation: scaleIn 0.5s ease-out;
    z-index: 1;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-gold-dark), var(--accent-gold), var(--accent-gold-light), var(--accent-gold));
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.login-logo i {
    font-size: 3rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
    display: block;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(212,175,55,0.3));
}

.login-logo h2 {
    color: var(--primary-black);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-black), var(--accent-gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-card form .mb-3 {
    animation: fadeInUp 0.5s ease-out both;
}
.login-card form .mb-3:nth-child(1) { animation-delay: 0.3s; }
.login-card form .mb-3:nth-child(2) { animation-delay: 0.4s; }
.login-card form .mb-3:nth-child(3) { animation-delay: 0.5s; }

/* ===== TIMELINE ===== */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-gold), var(--border-color));
}

.timeline-item {
    position: relative;
    padding: 0 0 30px 50px;
    animation: fadeInUp 0.4s ease-out both;
}
.timeline-item:nth-child(1) { animation-delay: 0.05s; }
.timeline-item:nth-child(2) { animation-delay: 0.1s; }
.timeline-item:nth-child(3) { animation-delay: 0.15s; }
.timeline-item:nth-child(4) { animation-delay: 0.2s; }
.timeline-item:nth-child(5) { animation-delay: 0.25s; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold));
    border: 3px solid var(--bg-light);
    z-index: 1;
    transition: var(--transition);
}

.timeline-item:hover::before {
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(212,175,55,0.5);
}

.timeline-item .timeline-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.timeline-item .timeline-content {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.timeline-item:hover .timeline-content {
    box-shadow: var(--shadow-md);
    border-left-color: var(--accent-gold);
}

.timeline-item .timeline-user {
    font-weight: 600;
    color: var(--accent-gold-dark);
}

/* ===== CHAT ===== */
.chat-container {
    height: calc(100vh - var(--topbar-height) - 48px);
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.5s ease-out;
}

.chat-sidebar {
    width: 300px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    background: linear-gradient(135deg, rgba(212,175,55,0.05), transparent);
}

.chat-contact-list {
    flex: 1;
    overflow-y: auto;
}

.chat-contact {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    position: relative;
}

.chat-contact::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-gold), transparent);
    transition: width 0.3s ease;
}

.chat-contact:hover::after,
.chat-contact.active::after {
    width: 100%;
}

.chat-contact:hover, .chat-contact.active {
    background: linear-gradient(90deg, rgba(212,175,55,0.05), rgba(212,175,55,0.1));
}

.chat-contact .online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
    position: absolute;
    bottom: 2px;
    right: 2px;
    border: 2px solid #fff;
    animation: glowPulse 2s infinite;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-light);
}

.chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.chat-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    animation: fadeInUp 0.3s ease-out;
}

.chat-message.sent {
    flex-direction: row-reverse;
}

.chat-bubble {
    max-width: 70%;
    padding: 10px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    transition: var(--transition);
}

.chat-message.received .chat-bubble {
    background: var(--bg-card);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.chat-message.received .chat-bubble:hover {
    box-shadow: var(--shadow-md);
}

.chat-message.sent .chat-bubble {
    background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold));
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 12px rgba(212,175,55,0.3);
}

.chat-bubble .chat-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
}

.chat-input-area {
    padding: 16px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input-area textarea {
    flex: 1;
    resize: none;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    font-size: 0.9rem;
    max-height: 100px;
    outline: none;
    transition: var(--transition);
}

.chat-input-area textarea:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.1);
}

/* ===== MODAL ===== */
.modal-content {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    animation: scaleIn 0.3s ease-out;
}

.modal-header {
    background: linear-gradient(135deg, #0f0f23, #2d2d44);
    color: #fff;
    border-bottom: none;
    padding: 16px 24px;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
    animation: fadeInUp 0.4s ease-out;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    position: relative;
}

.page-header h1::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), transparent);
    margin-top: 4px;
    border-radius: 2px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    animation: fadeIn 0.5s ease-out;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.5;
}

.empty-state h5 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* ===== QUICK ACCESS CARDS ===== */
.quick-access-card {
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    background: var(--bg-card);
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.quick-access-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 2px;
    background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold-light));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-access-card:hover::before {
    opacity: 1;
}

.quick-access-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-gold);
}

.quick-access-card i {
    transition: var(--transition-bounce);
}

.quick-access-card:hover i {
    transform: scale(1.2);
    animation: float 2s ease-in-out infinite;
}

/* ===== ALERTS ===== */
.alert {
    animation: fadeInUp 0.3s ease-out;
    border: none;
    border-radius: 10px;
}

.alert-gold {
    background: linear-gradient(135deg, rgba(212,175,55,0.1), rgba(212,175,55,0.05));
    border-left: 4px solid var(--accent-gold);
    color: var(--accent-gold-dark);
}

.alert-success {
    border-left: 4px solid #28a745;
}

.alert-danger {
    border-left: 4px solid #dc3545;
}

/* ===== PAGINATION ===== */
.pagination .page-link {
    border: none;
    border-radius: 8px;
    margin: 0 2px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold));
    color: #fff;
    box-shadow: 0 2px 8px rgba(212,175,55,0.3);
}

.pagination .page-link:hover {
    background: rgba(212,175,55,0.1);
    color: var(--accent-gold-dark);
}

/* ===== NAV PILLS ===== */
.nav-pills .nav-link {
    border-radius: 8px;
    color: var(--text-secondary);
    transition: var(--transition);
    font-weight: 500;
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold));
}

.nav-pills .nav-link:hover:not(.active) {
    background: rgba(212,175,55,0.1);
    color: var(--accent-gold-dark);
}

/* ===== DROPDOWN ===== */
.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: 10px;
    animation: scaleIn 0.2s ease-out;
    overflow: hidden;
}

.dropdown-item {
    transition: var(--transition);
}

.dropdown-item:hover {
    background: linear-gradient(90deg, rgba(212,175,55,0.08), rgba(212,175,55,0.04));
    color: var(--accent-gold-dark);
}

/* ===== INVOICE PRINT ===== */
.invoice-container {
    animation: fadeIn 0.5s ease-out;
}

@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .content { margin-left: 0 !important; width: 100% !important; }
    .main-content { padding: 0 !important; }
    .invoice-container { box-shadow: none !important; border: none !important; animation: none !important; }
}

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

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--accent-gold-dark), var(--accent-gold));
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* ===== STAGGER ANIMATION FOR CARDS ===== */
.card-stagger > * {
    animation: fadeInUp 0.4s ease-out both;
}
.card-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.card-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.card-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.card-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.card-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.card-stagger > *:nth-child(6) { animation-delay: 0.3s; }
.card-stagger > *:nth-child(7) { animation-delay: 0.35s; }
.card-stagger > *:nth-child(8) { animation-delay: 0.4s; }

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
        animation: slideInLeft 0.3s ease-out;
    }
    .content {
        margin-left: 0;
        width: 100%;
    }
    .chat-sidebar {
        width: 100%;
        position: absolute;
        z-index: 10;
        height: 100%;
    }
    .chat-container {
        position: relative;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px;
    }
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    .page-header h1 {
        font-size: 1.2rem;
    }
    .login-card {
        padding: 24px;
    }
    .notification-dropdown {
        width: 280px;
    }
    .stat-card:hover {
        transform: translateY(-2px);
    }
}

@media (max-width: 576px) {
    .stat-card {
        padding: 16px;
    }
    .topbar {
        padding: 0 12px;
    }
    .table-responsive {
        font-size: 0.85rem;
    }
}

/* ===== TRANSITION UTILITY CLASSES ===== */
.fade-in { animation: fadeIn 0.5s ease-out; }
.fade-in-up { animation: fadeInUp 0.5s ease-out; }
.slide-in-left { animation: slideInLeft 0.5s ease-out; }
.slide-in-right { animation: slideInRight 0.5s ease-out; }
.scale-in { animation: scaleIn 0.3s ease-out; }
