:root {
    /* Premium Corporate Theme - Gold & Dark */
    --bg-color: #f8f9fa;
    --bg-secondary: #f1f3f5;
    --sidebar-bg: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    --sidebar-text: #a0aec0;
    --sidebar-text-active: #ffffff;
    --sidebar-hover: rgba(212, 175, 55, 0.15);

    --surface-color: #ffffff;
    --primary-color: #d4af37;
    /* Gold */
    --primary-hover: #c9a227;
    --primary-dark: #b8960f;
    --primary-gradient: linear-gradient(135deg, #d4af37 0%, #f4d03f 50%, #d4af37 100%);
    --accent-gradient: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);

    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --border-color: #e9ecef;

    /* Action Colors */
    --action-info: #3b82f6;
    --action-success: #10b981;
    --action-warning: #f59e0b;
    --action-danger: #ef4444;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.25);

    /* Glass effect */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.2);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
    position: relative;
}

/* Nav Menu (used by centralized nav.js) */
.nav-menu {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
    position: relative;
}

.nav-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

.nav-menu a {
    color: var(--sidebar-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-menu a:hover {
    background-color: var(--sidebar-hover);
    color: var(--primary-color);
}

.nav-menu a.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.2) 0%, transparent 100%);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    padding-left: calc(1rem - 3px);
    font-weight: 600;
}

.nav-menu .spacer {
    flex: 1;
}

.nav-menu .user-section {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
}

.nav-menu .logout-link {
    cursor: pointer;
    margin-top: 0.5rem;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    color: inherit;
}

.sidebar .brand,
.nav-menu .brand {
    color: white;
}

.logo-icon {
    font-size: 1.5rem;
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.sidebar nav {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-divider {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1.5rem 0 0.5rem 0;
    font-weight: 600;
    color: #475569;
}

.nav-item {
    background: none;
    border: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    padding-left: calc(1rem - 3px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.2) 0%, transparent 100%);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    padding-left: calc(1rem - 3px);
    font-weight: 600;
}

.nav-item .icon {
    font-size: 1.1rem;
}

.badge-count {
    margin-left: auto;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    min-width: 1.5rem;
    text-align: center;
}

.nav-item.active .badge-count {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #334155;
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

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

.user-info .name {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.user-info .role {
    font-size: 0.75rem;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    overflow: hidden;
}

.top-bar {
    background-color: var(--surface-color);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.primary-btn {
    background: var(--primary-gradient);
    color: #1a1a2e;
    border: none;
    padding: 0.65rem 1.4rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    box-shadow: var(--shadow-gold);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.025em;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.35);
    filter: brightness(1.05);
}

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

.secondary-btn {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(212, 175, 55, 0.05);
}

/* Views */
.view-section {
    padding: 2rem;
    overflow-y: auto;
    height: 100%;
}

.view-section.hidden {
    display: none;
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

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

.stat-card h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, #1a1a2e 0%, #d4af37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.recent-activity {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.recent-activity h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

#activity-log {
    list-style: none;
}

#activity-log li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#activity-log li:last-child {
    border-bottom: none;
}

/* Tables */
.table-container {
    background-color: var(--surface-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.data-table th {
    background-color: #f8fafc;
    padding: 1rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

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

.data-table .actions-cell {
    white-space: nowrap;
}

.icon-btn {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.icon-btn:hover {
    background-color: #f1f5f9;
    border-color: var(--border-color);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-new {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-contacted {
    background-color: #e0e7ff;
    color: #3730a3;
}

.status-pending_negotiation {
    background-color: #fef3c7;
    color: #92400e;
}

.status-negotiation {
    background-color: #d1fae5;
    color: #065f46;
}

.status-sampling {
    background-color: #fce7f3;
    color: #9d174d;
}

.status-order {
    background-color: #cffafe;
    color: #0e7490;
}

.status-closed {
    background-color: #f3f4f6;
    color: #374151;
}

/* Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.badge.priority-High {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge.priority-Medium {
    background-color: #fef3c7;
    color: #92400e;
}

.badge.priority-Low {
    background-color: #d1fae5;
    color: #065f46;
}

.stage-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    background-color: #e0e7ff;
    color: #3730a3;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.2s;
}

.modal.hidden {
    display: none;
    opacity: 0;
}

/* Generic Hidden Utility */
.hidden {
    display: none !important;
}

.modal-content {
    background-color: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 900px;
    /* Wider modal for 3 columns */
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

.modal-content.small {
    max-width: 500px;
}

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

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

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn,
.close-btn-transition {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

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

/* Forms */
form {
    padding: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 Columns */
    gap: 1rem;
}

.form-group {
    margin-bottom: 0.75rem;
}

.span-3 {
    grid-column: span 3;
}

.span-2 {
    grid-column: span 2;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 1rem;
}

/* Login Screen */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f1a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4af37' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.login-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(212, 175, 55, 0.1);
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    animation: fadeInUp 0.5s ease-out;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 1rem 1rem 0 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.login-box .brand {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
}

.login-box .brand h1 {
    color: var(--text-primary);
    font-size: 2.2rem;
    letter-spacing: 2px;
    margin: 0;
    line-height: 1;
    font-weight: 800;
}

.login-box .brand span {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

.login-box .brand span::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.login-box .brand .logo-icon {
    font-size: 2.5rem;
}



.login-box h2 {
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.login-box .form-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.login-box .form-group label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-box .form-group input {
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-box .form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
}

.login-box .full-width {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    background: var(--primary-gradient);
    border: none;
    border-radius: 0.5rem;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-box .full-width:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.4);
    filter: brightness(1.05);
}

.login-box .full-width:active {
    transform: translateY(0);
}

.error-msg {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fef2f2;
    border-radius: 0.5rem;
    border: 1px solid #fecaca;
}

.login-help {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: left;
}

/* ================================================
   PREMIUM UI ENHANCEMENTS
   ================================================ */

/* Unified Workspace Styles */
.lead-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.conversation-timeline {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-item {
    display: flex;
    gap: 1rem;
}

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
    background: white;
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.timeline-action {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.timeline-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.timeline-author {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-align: right;
    font-style: italic;
}

.timeline-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
    background: white;
    border-radius: var(--radius);
    border: 1px dashed var(--border-color);
}

/* Toast Notifications */
.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--glass-border);
    min-width: 300px;
    max-width: 450px;
    font-size: 0.9rem;
    transform: translateX(110%);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-hiding {
    transform: translateX(110%);
    opacity: 0;
}

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

.toast-success .toast-icon {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.toast-error .toast-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.toast-warning .toast-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.toast-info .toast-icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading Button State */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text-sm {
    height: 0.75rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 100px;
}

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

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

/* Enhanced Button Hover Effects */
.primary-btn {
    position: relative;
    overflow: hidden;
}

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

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

/* Card Hover Animations */
.stat-card {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(212, 175, 55, 0.15);
}

/* Table Row Animations */
.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: rgba(212, 175, 55, 0.04);
    transform: scale(1.002);
}

/* Input Focus Animations */
input:focus,
select:focus,
textarea:focus {
    animation: focusPulse 0.3s ease-out;
}

@keyframes focusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4);
    }

    100% {
        box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
    }
}

/* Modal Animations */
.modal-content {
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Page Load Animation */
@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.content {
    animation: pageLoad 0.4s ease-out;
}

/* Status Badge Hover */
.status-badge {
    transition: all 0.2s ease;
    cursor: default;
}

.status-badge:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

/* Action Button Ripple */
.action-btn {
    position: relative;
    overflow: hidden;
}

.action-btn:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.3);
    transform: translate(-50%, -50%);
    animation: ripple 0.4s ease-out;
}

@keyframes ripple {
    to {
        width: 150px;
        height: 150px;
        opacity: 0;
    }
}

/* Mobile Responsive Enhancements */
@media (max-width: 768px) {
    .nav-menu {
        width: 200px;
        padding: 1rem;
    }

    .nav-menu .brand h1 {
        font-size: 0.95rem;
    }

    .content {
        padding: 1rem;
    }

    .stats-row,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .value,
    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .toast {
        min-width: 250px;
        max-width: 90vw;
        right: 5vw;
    }

    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .leads-table {
        font-size: 0.8rem;
    }

    .leads-table th,
    .leads-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .page-wrapper {
        flex-direction: column;
    }

    .nav-menu {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.75rem;
        gap: 0.25rem;
    }

    .nav-menu .brand {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .nav-menu a {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .nav-menu .spacer {
        display: none;
    }

    .nav-menu .user-section {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 0.5rem;
        margin-top: 0.5rem;
    }

    .stats-row,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .top-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}