/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f9fafb;
    color: #111827;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 256px;
    background: white;
    border-right: 1px solid #e5e7eb;
    z-index: 50;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.main-content {
    flex: 1;
    margin-left: 256px;
    display: flex;
    flex-direction: column;
    --app-header-height: 73px;
    padding-top: var(--app-header-height);
    min-width: 0;
    width: 100%;
}

/* Sidebar Styles */
.sidebar-header {
    height: 80px;
    padding: 0 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.logo-version {
    font-size: 12px;
    color: #6b7280;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
    min-height: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: #f9fafb;
    color: #111827;
}

.nav-item.active {
    background-color: #f3e8ff;
    color: #7c3aed;
    font-weight: 600;
}

.nav-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item.active .nav-item-icon {
    color: #7c3aed;
}

.nav-item-arrow {
    width: 16px;
    height: 16px;
    color: #9ca3af;
}

.upgrade-box {
    margin: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    border-radius: 12px;
    color: white;
    margin-bottom: 16px;
}

.upgrade-text {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

.upgrade-button {
    width: 100%;
    padding: 8px;
    background: white;
    color: #7c3aed;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.upgrade-button:hover {
    background: #f3e8ff;
}

.sidebar-user {
    position: relative;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown {
    padding: 6px;
    color: #6b7280;
    cursor: pointer;
    border: none;
    background: none;
    transition: all 0.2s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-dropdown:hover {
    color: #374151;
    background: #f3f4f6;
}

.user-dropdown-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 16px;
    right: 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.user-dropdown-item:hover {
    background-color: #f9fafb;
    color: #111827;
}

.user-dropdown-item svg {
    color: #6b7280;
    flex-shrink: 0;
}

.user-dropdown-item:hover svg {
    color: #374151;
}

.user-dropdown-item-logout {
    color: #dc2626;
    border-top: 1px solid #e5e7eb;
}

.user-dropdown-item-logout:hover {
    background-color: #fef2f2;
    color: #991b1b;
}

.user-dropdown-item-logout svg {
    color: #dc2626;
}

.user-dropdown-item-logout:hover svg {
    color: #991b1b;
}

.user-dropdown-item-form {
    width: 100%;
}

/* Header Styles */
.header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: fixed;
    top: 0;
    left: 256px;
    right: 0;
    z-index: 40;
}

/* Header layout — detailed search bar styles live in topbar.blade.php @push('styles') */
.header-content {
    min-height: 72px;
    padding: 16px 24px;
}

.header-title {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
}

.header-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}


/* Content Area */
.content {
    flex: 1;
    padding: 24px;
    background: #f9fafb;
}

/* Statistics and Analysis Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card-header {
    margin-bottom: 20px;
}

.stat-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.stat-card-description {
    font-size: 12px;
    color: #6b7280;
}

.stat-card-content {
    position: relative;
}

.stat-chart-container {
    height: 256px;
    position: relative;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.kpi-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.kpi-label {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    background: #f3e8ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon svg {
    width: 20px;
    height: 20px;
    color: #7c3aed;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.kpi-trend {
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up {
    color: #10b981;
    font-size: 14px;
    font-weight: 500;
}

.trend-down {
    color: #ef4444;
    font-size: 14px;
    font-weight: 500;
}

.trend-text {
    font-size: 14px;
    color: #6b7280;
}

/* Table Styles */
.table-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.table-title-section {
    margin-bottom: 16px;
}

.table-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.table-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-search {
    position: relative;
}

.table-search-input {
    width: 256px;
    padding: 8px 12px 8px 40px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.table-search-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background: white;
    cursor: pointer;
    transition: background 0.2s;
}

.sort-dropdown:hover {
    background: #f9fafb;
}

.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: #f9fafb;
}

.table th {
    padding: 12px 24px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 16px 24px;
    font-size: 14px;
    color: #374151;
    border-top: 1px solid #e5e7eb;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: #f9fafb;
}

.table-link {
    color: #111827;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.table-link:hover {
    color: #7c3aed;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

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

.status-approved {
    background: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

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

.status-win {
    background: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

.status-lost {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.status-back-up,
.status-backup {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #c7d2fe;
}

.status-budget {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.status-prospect {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.status-on-hold {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}

.status-draft,
.status-sent,
.status-final {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}

.status-not-submitted {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #e5e7eb;
}

.status-work-in-progress {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.status-submitted {
    background: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

/* Pagination */
.pagination {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pagination-info {
    font-size: 14px;
    color: #374151;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-button {
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    color: #374151;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-button:hover {
    background: #f9fafb;
}

.pagination-button.active {
    background: #7c3aed;
    color: white;
    border-color: #7c3aed;
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: #6b7280;
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    display: none;
}

.mobile-overlay.show {
    display: block;
}

/* Mobile Menu Button */
.mobile-menu-button {
    display: none;
    padding: 6px;
    border-radius: 6px;
    color: #4b5563;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-button:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }

    .header {
        left: 0;
    }
    
    .mobile-menu-button {
        display: block;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 16px;
    }
    
    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-search-input {
        width: 100%;
    }
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10070;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    min-width: 320px;
    max-width: 420px;
    padding: 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
    position: relative;
}

.toast.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast.toast-success {
    border-left: 4px solid #10b981;
}

.toast.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: 2px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.toast-message {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #9ca3af;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.toast-clickable {
    cursor: pointer;
}

.toast-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

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

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.hiding {
    animation: slideOutRight 0.3s ease-out forwards;
}

@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }
}

/* Confirm dialog (scoped; critical rules also in partials/confirm-dialog.blade.php) */
#confirmDialog.confirm-dialog {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

#confirmDialog.confirm-dialog.is-open {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

#confirmDialog.confirm-dialog[hidden] {
    display: none !important;
}

#confirmDialog .confirm-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(2px);
    z-index: 0;
}

#confirmDialog .confirm-dialog-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 28px 28px 24px;
    text-align: center;
    transform: scale(0.95) translateY(8px);
    transition: transform 0.2s ease;
}

.confirm-dialog.is-open .confirm-dialog-panel {
    transform: scale(1) translateY(0);
}

#confirmDialog .confirm-dialog-icon {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

#confirmDialog .confirm-dialog-icon svg {
    display: block !important;
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    flex-shrink: 0;
}

.confirm-dialog-icon--danger {
    background: #fef2f2;
    color: #ef4444;
}

.confirm-dialog-icon--warning {
    background: #fffbeb;
    color: #f59e0b;
}

.confirm-dialog-icon--primary {
    background: #f5f3ff;
    color: #7c3aed;
}

.confirm-dialog-icon--success {
    background: #f0fdf4;
    color: #10b981;
}

.confirm-dialog-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px;
    line-height: 1.35;
}

.confirm-dialog-message {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.55;
    margin: 0 0 24px;
}

.confirm-dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-dialog-btn {
    flex: 1;
    max-width: 160px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    font-family: inherit;
}

.confirm-dialog-btn-cancel {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.confirm-dialog-btn-cancel:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.confirm-dialog-btn-confirm {
    border: none;
    color: #ffffff;
}

.confirm-dialog-btn-confirm--danger {
    background: #ef4444;
}

.confirm-dialog-btn-confirm--danger:hover {
    background: #dc2626;
}

.confirm-dialog-btn-confirm--warning {
    background: #f59e0b;
}

.confirm-dialog-btn-confirm--warning:hover {
    background: #d97706;
}

.confirm-dialog-btn-confirm--primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.confirm-dialog-btn-confirm--primary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.confirm-dialog-btn-confirm--success {
    background: #10b981;
}

.confirm-dialog-btn-confirm--success:hover {
    background: #059669;
}

/* First-time onboarding tour (overlay only) */
body.onboarding-tour-active {
    overflow: hidden;
}

.onboarding-tour {
    position: fixed;
    inset: 0;
    z-index: 10050;
    pointer-events: auto;
}

.onboarding-tour-spotlight {
    position: fixed;
    z-index: 10051;
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.62);
    pointer-events: none;
    transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.onboarding-tour-panel {
    position: fixed;
    z-index: 10052;
    width: min(420px, calc(100vw - 32px));
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    padding: 20px 22px 18px;
    font-family: inherit;
}

.onboarding-tour-panel--centered {
    max-width: 480px;
}

.onboarding-tour-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.onboarding-tour-step-label {
    font-size: 12px;
    font-weight: 600;
    color: #7c3aed;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.onboarding-tour-close {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 6px;
}

.onboarding-tour-close:hover {
    color: #374151;
    background: #f3f4f6;
}

.onboarding-tour-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}

.onboarding-tour-body {
    margin: 0 0 20px;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.55;
}

.onboarding-tour-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.onboarding-tour-actions-nav {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.onboarding-tour-btn {
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    padding: 9px 16px;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid transparent;
}

.onboarding-tour-btn-ghost {
    background: transparent;
    color: #6b7280;
    border-color: transparent;
}

.onboarding-tour-btn-ghost:hover {
    color: #374151;
    background: #f9fafb;
}

.onboarding-tour-btn-secondary {
    background: #ffffff;
    color: #374151;
    border-color: #d1d5db;
}

.onboarding-tour-btn-secondary:hover {
    background: #f9fafb;
}

.onboarding-tour-btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #ffffff;
    border: none;
}

.onboarding-tour-btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

/* Global loading overlay (form saves & page navigation) */
html.crm-loading-active,
body.app-loading-active {
    overflow: hidden;
}

html.crm-loading-active #appLoadingOverlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

html.crm-loading-active body {
    background: #f9fafb;
}

.app-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(249, 250, 251, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.app-loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.app-loading-overlay-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    width: min(340px, calc(100vw - 48px));
    padding: 32px 32px 28px;
    background: #ffffff;
    border: 1px solid #e9d5ff;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(124, 58, 237, 0.14), 0 8px 16px rgba(15, 23, 42, 0.06);
}

.app-loading-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 2px;
}

.app-loading-spinner {
    position: relative;
    width: 68px;
    height: 68px;
}

.app-loading-spinner::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid #ede9fe;
    border-top-color: #7c3aed;
    border-right-color: #9333ea;
    border-radius: 50%;
    animation: app-loading-spin 0.85s linear infinite;
}

.app-loading-logo {
    position: absolute;
    inset: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 24px);
    object-fit: contain;
}

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

.app-loading-overlay-text {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    text-align: center;
}

.app-loading-progress-track {
    width: 100%;
    height: 8px;
    background: #ede9fe;
    border-radius: 999px;
    overflow: hidden;
}

.app-loading-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.app-loading-percent {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #7c3aed;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
