/* ========================================
   MERCHANT360 COMPONENT LIBRARY
   Reusable UI Components
   ======================================== */

/* ----------------------------------------
   Button Components
   ---------------------------------------- */

/* Base Button Styles */
.btn {
    font-weight: var(--font-medium);
    border-radius: var(--radius-lg);
    padding: 0.625rem 1.25rem;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Gradient Primary Button */
.btn-gradient {
    background: var(--gradient-cta);
    border: none;
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow-accent);
    color: var(--text-inverse);
}

.btn-gradient:active {
    transform: translateY(0);
}

/* Gradient Primary Blue */
.btn-gradient-primary {
    background: var(--gradient-hero);
    border: none;
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.btn-gradient-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    color: var(--text-inverse);
}

/* Success Gradient */
.btn-gradient-success {
    background: var(--gradient-success);
    border: none;
    color: var(--text-inverse);
}

.btn-gradient-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--text-inverse);
}

/* Glow Effect Button */
.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::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;
}

.btn-glow:hover::before {
    left: 100%;
}

/* Outline Animated Button */
.btn-outline-animated {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-outline-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--primary);
    transition: width var(--transition-base);
    z-index: -1;
}

.btn-outline-animated:hover {
    color: var(--text-inverse);
}

.btn-outline-animated:hover::before {
    width: 100%;
}

/* Icon Button */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
}

.btn-icon-lg {
    width: 48px;
    height: 48px;
}

/* Button Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Button Sizes */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: var(--text-xs);
}

.btn-xl {
    padding: 1rem 2rem;
    font-size: var(--text-lg);
}

/* ----------------------------------------
   Card Components
   ---------------------------------------- */

/* Base Card */
.card-modern {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    overflow: hidden;
}

.card-modern:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

/* Product Card */
.product-card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    overflow: hidden;
    position: relative;
}

.product-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-8px);
}

.product-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--gray-100);
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-card-image img {
    transform: scale(1.08);
}

.product-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.product-card:hover .product-card-overlay {
    opacity: 1;
}

.product-card-body {
    padding: var(--space-4);
}

.product-card-title {
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-sku {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.product-card-price {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--primary);
}

.product-card-price-old {
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: var(--space-2);
}

.product-card-footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: var(--space-2);
}

/* Stat Card (Dashboard KPI) */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-4);
}

.stat-card-icon.primary {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-card-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.stat-card-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-card-icon.accent {
    background: var(--accent-light);
    color: var(--accent);
}

.stat-card-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--space-1);
}

.stat-card-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.stat-card-trend {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
}

.stat-card-trend.up {
    background: var(--success-light);
    color: var(--success);
}

.stat-card-trend.down {
    background: var(--sale-light);
    color: var(--sale);
}

/* Feature Card */
.feature-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border: 1px solid transparent;
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
    transform: translateY(-4px);
}

.feature-card-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--gradient-hero);
    color: var(--text-inverse);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-lg);
}

.feature-card-title {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-3);
}

.feature-card-text {
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

/* ----------------------------------------
   Badge Components
   ---------------------------------------- */

/* Base Badge */
.badge-modern {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0.25rem 0.75rem;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Status Badges */
.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-hover);
}

.badge-danger {
    background: var(--sale-light);
    color: var(--sale);
}

.badge-info {
    background: var(--info-light);
    color: var(--info-hover);
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-accent {
    background: var(--accent-light);
    color: var(--accent);
}

.badge-neutral {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* Sale Badge */
.badge-sale {
    background: var(--sale);
    color: var(--text-inverse);
    font-weight: var(--font-bold);
}

/* New Badge */
.badge-new {
    background: var(--gradient-success);
    color: var(--text-inverse);
}

/* Hot Badge */
.badge-hot {
    background: var(--gradient-cta);
    color: var(--text-inverse);
}

/* Floating Badge (for product cards) */
.badge-floating {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    z-index: 10;
}

.badge-floating-right {
    left: auto;
    right: var(--space-3);
}

/* ----------------------------------------
   Form Components
   ---------------------------------------- */

/* Form Group */
.form-group-modern {
    margin-bottom: var(--space-5);
}

/* Floating Label Input */
.form-floating-modern {
    position: relative;
}

.form-floating-modern .form-control {
    height: 56px;
    padding: 1.5rem 1rem 0.5rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--surface);
    transition: all var(--transition-base);
}

.form-floating-modern .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.form-floating-modern label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: all var(--transition-base);
    pointer-events: none;
    background: var(--surface);
    padding: 0 0.25rem;
}

.form-floating-modern .form-control:focus ~ label,
.form-floating-modern .form-control:not(:placeholder-shown) ~ label {
    top: 0;
    font-size: var(--text-xs);
    color: var(--primary);
}

/* Enhanced Input */
.form-control-modern {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--surface);
    transition: all var(--transition-base);
    font-size: var(--text-base);
}

.form-control-modern:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    outline: none;
}

.form-control-modern::placeholder {
    color: var(--text-muted);
}

/* Input with Icon */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .form-control {
    padding-left: 2.75rem;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Validation States */
.form-control.is-valid-modern {
    border-color: var(--success);
}

.form-control.is-valid-modern:focus {
    box-shadow: 0 0 0 4px var(--success-light);
}

.form-control.is-invalid-modern {
    border-color: var(--sale);
}

.form-control.is-invalid-modern:focus {
    box-shadow: 0 0 0 4px var(--sale-light);
}

/* Password Strength Indicator */
.password-strength {
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    margin-top: var(--space-2);
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-base), background var(--transition-base);
}

.password-strength-bar.weak {
    width: 25%;
    background: var(--sale);
}

.password-strength-bar.fair {
    width: 50%;
    background: var(--warning);
}

.password-strength-bar.good {
    width: 75%;
    background: var(--info);
}

.password-strength-bar.strong {
    width: 100%;
    background: var(--success);
}

/* ----------------------------------------
   Navigation Components
   ---------------------------------------- */

/* Search Bar */
.search-bar {
    position: relative;
    max-width: 400px;
}

.search-bar .form-control {
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border-radius: var(--radius-full);
    border: 2px solid var(--gray-200);
    background: var(--surface);
}

.search-bar .form-control:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.search-bar .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar .search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Cart Badge */
.cart-badge {
    position: relative;
}

.cart-badge .badge-count {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: var(--font-bold);
    line-height: 20px;
    text-align: center;
    background: var(--accent);
    color: var(--text-inverse);
    border-radius: var(--radius-full);
    animation: scaleIn var(--transition-base) ease-out;
}

/* ----------------------------------------
   Table Components
   ---------------------------------------- */

.table-modern {
    background: var(--surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-modern thead {
    background: var(--gray-50);
}

.table-modern thead th {
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: var(--text-xs);
    letter-spacing: 0.05em;
    padding: var(--space-4);
    border-bottom: 2px solid var(--gray-200);
}

.table-modern tbody td {
    padding: var(--space-4);
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
}

.table-modern tbody tr {
    transition: background var(--transition-fast);
}

.table-modern tbody tr:hover {
    background: var(--gray-50);
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* ----------------------------------------
   Alert Components
   ---------------------------------------- */

.alert-modern {
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.alert-modern.alert-success {
    background: var(--success-light);
    color: var(--success);
}

.alert-modern.alert-danger {
    background: var(--sale-light);
    color: var(--sale);
}

.alert-modern.alert-warning {
    background: var(--warning-light);
    color: var(--warning-hover);
}

.alert-modern.alert-info {
    background: var(--info-light);
    color: var(--info-hover);
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* ----------------------------------------
   Progress Components
   ---------------------------------------- */

/* Step Progress */
.step-progress {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: var(--space-8);
}

.step-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gray-200);
    z-index: 0;
}

.step-progress-bar {
    position: absolute;
    top: 20px;
    left: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-slow);
    z-index: 1;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--surface);
    border: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-semibold);
    color: var(--text-muted);
    transition: all var(--transition-base);
}

.step-item.active .step-circle {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--text-inverse);
}

.step-item.completed .step-circle {
    border-color: var(--success);
    background: var(--success);
    color: var(--text-inverse);
}

.step-label {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: var(--font-medium);
}

.step-item.active .step-label,
.step-item.completed .step-label {
    color: var(--text-primary);
}

/* ----------------------------------------
   Loading Components
   ---------------------------------------- */

/* Spinner */
.spinner-modern {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-modern.sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.spinner-modern.lg {
    width: 56px;
    height: 56px;
    border-width: 4px;
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text.sm {
    width: 60%;
}

.skeleton-text.md {
    width: 80%;
}

.skeleton-title {
    height: 1.5em;
    width: 40%;
    margin-bottom: 1em;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
}

.skeleton-image {
    aspect-ratio: 1;
    width: 100%;
}

.skeleton-card {
    height: 200px;
}

/* ----------------------------------------
   Toast Notification
   ---------------------------------------- */

.toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast-modern {
    min-width: 300px;
    max-width: 400px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-4);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    animation: slideInRight var(--transition-base) ease-out;
}

.toast-modern.success {
    border-left: 4px solid var(--success);
}

.toast-modern.error {
    border-left: 4px solid var(--sale);
}

.toast-modern.warning {
    border-left: 4px solid var(--warning);
}

.toast-modern.info {
    border-left: 4px solid var(--info);
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
}

.toast-message {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 1.25rem;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    animation: toast-progress 5s linear forwards;
}

@keyframes toast-progress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ----------------------------------------
   Modal Enhancements
   ---------------------------------------- */

.modal-modern .modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
}

.modal-modern .modal-header {
    border-bottom: 1px solid var(--gray-100);
    padding: var(--space-5) var(--space-6);
}

.modal-modern .modal-title {
    font-weight: var(--font-semibold);
}

.modal-modern .modal-body {
    padding: var(--space-6);
}

.modal-modern .modal-footer {
    border-top: 1px solid var(--gray-100);
    padding: var(--space-4) var(--space-6);
}

/* ----------------------------------------
   Dropdown Enhancements
   ---------------------------------------- */

.dropdown-menu-modern {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-2);
    min-width: 200px;
}

.dropdown-menu-modern .dropdown-item {
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    transition: all var(--transition-fast);
}

.dropdown-menu-modern .dropdown-item:hover {
    background: var(--gray-100);
}

.dropdown-menu-modern .dropdown-item.active {
    background: var(--primary);
    color: var(--text-inverse);
}

.dropdown-menu-modern .dropdown-divider {
    margin: var(--space-2) 0;
    border-color: var(--gray-100);
}

/* ----------------------------------------
   Quantity Selector
   ---------------------------------------- */

.quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.quantity-selector button {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-50);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-selector button:hover {
    background: var(--gray-100);
}

.quantity-selector button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-selector input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-weight: var(--font-semibold);
    font-size: var(--text-base);
}

.quantity-selector input:focus {
    outline: none;
}

/* ----------------------------------------
   Empty State
   ---------------------------------------- */

.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-8);
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: var(--space-6);
}

.empty-state-title {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-state-text {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ----------------------------------------
   Divider
   ---------------------------------------- */

.divider {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    color: var(--text-muted);
    margin: var(--space-6) 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* ========================================
   VENDOREA FINANCE MODULE COMPONENTS
   Accounts Receivable & Accounts Payable
   ======================================== */

/* ----------------------------------------
   Finance Page Layout
   ---------------------------------------- */
.finance-page {
    background: var(--vendorea-bg);
    min-height: 100vh;
    padding: var(--space-8) 0;
}

.finance-page .container-fluid {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

@media (min-width: 992px) {
    .finance-page .container-fluid {
        padding-left: var(--space-8);
        padding-right: var(--space-8);
    }
}

@media (min-width: 1600px) {
    .finance-page .container-fluid {
        max-width: 1800px;
    }
}

/* ----------------------------------------
   Finance Card (Base)
   ---------------------------------------- */
.finance-card {
    background: var(--vendorea-surface);
    border: 1px solid var(--vendorea-border);
    border-radius: var(--vendorea-radius-xl);
    box-shadow: var(--vendorea-shadow-md);
}

.finance-card-header {
    background: var(--vendorea-panel);
    border-bottom: 1px solid var(--vendorea-border);
    padding: var(--space-5) var(--space-6);
}

@media (min-width: 992px) {
    .finance-card-header {
        padding: var(--space-6) var(--space-8);
    }
}

.finance-card-body {
    padding: var(--space-5) var(--space-6);
}

@media (min-width: 992px) {
    .finance-card-body {
        padding: var(--space-6) var(--space-8);
    }
}

/* ----------------------------------------
   Finance Header Card (Page Title)
   ---------------------------------------- */
.finance-header-card {
    background: var(--vendorea-surface);
    border: 1px solid var(--vendorea-border);
    border-radius: var(--vendorea-radius-xl);
    box-shadow: var(--vendorea-shadow-md);
    overflow: hidden;
    margin-bottom: var(--space-8);
}

.finance-header-gradient {
    height: 6px;
    background: var(--vendorea-gradient-header);
}

.finance-header-gradient.ar {
    background: var(--vendorea-ar-gradient);
}

.finance-header-gradient.ap {
    background: var(--vendorea-ap-gradient);
}

.finance-header-content {
    padding: var(--space-5) var(--space-6);
}

@media (min-width: 992px) {
    .finance-header-content {
        padding: var(--space-6) var(--space-8);
    }
}

.finance-header-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--vendorea-radius-md);
    color: var(--vendorea-surface);
    font-size: 1.75rem;
}

.finance-header-icon.ar {
    background: var(--vendorea-gradient-primary);
}

.finance-header-icon.ap {
    background: linear-gradient(135deg, var(--vendorea-ap-primary), #6D28D9);
}

.finance-header-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-1);
}

.finance-header-label.ar {
    color: var(--vendorea-ar-primary);
}

.finance-header-label.ap {
    color: var(--vendorea-ap-primary);
}

.finance-header-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    color: var(--vendorea-text);
    margin: 0;
}

.finance-header-description {
    color: var(--vendorea-muted);
    font-size: 15px;
    line-height: 1.6;
    max-width: 550px;
    margin: 0;
}

/* ----------------------------------------
   Finance Summary Cards (KPI)
   ---------------------------------------- */
.finance-summary-card {
    background: var(--vendorea-surface);
    border: 1px solid var(--vendorea-border);
    border-radius: var(--vendorea-radius-xl);
    box-shadow: var(--vendorea-shadow-sm);
    padding: var(--space-5);
    min-height: 140px;
    transition: all 0.2s ease;
}

.finance-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--vendorea-shadow-lg);
}

@media (min-width: 1400px) {
    .finance-summary-card {
        min-height: 160px;
        padding: var(--space-6);
    }
}

.finance-summary-label {
    font-weight: var(--font-medium);
    color: var(--vendorea-muted);
    margin-bottom: var(--space-3);
}

.finance-summary-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-semibold);
    color: var(--vendorea-text);
    margin-bottom: var(--space-3);
}

@media (min-width: 1400px) {
    .finance-summary-value {
        font-size: 2rem;
    }
}

.finance-summary-meta {
    font-size: var(--text-sm);
    color: var(--vendorea-muted);
}

.finance-summary-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* ----------------------------------------
   Finance Buttons
   ---------------------------------------- */
.btn-finance-primary {
    background: var(--vendorea-gradient-primary);
    color: var(--vendorea-surface);
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--vendorea-radius-md);
    font-weight: var(--font-medium);
    transition: all 0.2s ease;
}

.btn-finance-primary:hover {
    opacity: 0.95;
    color: var(--vendorea-surface);
}

.btn-finance-primary.ap {
    background: linear-gradient(135deg, var(--vendorea-ap-primary), #6D28D9);
}

.btn-finance-secondary {
    background: var(--vendorea-info-light);
    color: var(--vendorea-ar-primary);
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--vendorea-radius-md);
    font-weight: var(--font-medium);
    transition: all 0.2s ease;
}

.btn-finance-secondary:hover {
    background: #BFDBFE;
    color: var(--vendorea-ar-primary);
}

.btn-finance-secondary.ap {
    background: #EDE9FE;
    color: var(--vendorea-ap-primary);
}

.btn-finance-secondary.ap:hover {
    background: #DDD6FE;
    color: var(--vendorea-ap-primary);
}

/* ----------------------------------------
   Finance Table
   ---------------------------------------- */
.finance-table {
    width: 100%;
    margin-bottom: 0;
}

.finance-table thead {
    background: var(--vendorea-surface);
    border-bottom: 1px solid var(--vendorea-border);
}

.finance-table th {
    font-size: 11px;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--vendorea-muted);
    padding: var(--space-4) var(--space-5) !important;
    white-space: nowrap;
}

.finance-table td {
    padding: var(--space-4) var(--space-5) !important;
    vertical-align: middle;
    color: var(--vendorea-text);
}

.finance-table tbody tr {
    border-bottom: 1px solid var(--vendorea-border-soft);
    transition: background-color 0.15s ease;
}

.finance-table tbody tr:hover {
    background-color: var(--vendorea-panel);
}

.finance-table tbody tr.selected {
    background-color: var(--vendorea-info-light);
}

.finance-table tbody tr.selected.ap {
    background-color: #FAF5FF;
}

.finance-table-link {
    color: var(--vendorea-ar-primary);
    font-weight: var(--font-semibold);
    text-decoration: none;
}

.finance-table-link:hover {
    color: var(--vendorea-blue-light);
}

.finance-table-link.ap {
    color: var(--vendorea-ap-primary);
}

.finance-table-link.ap:hover {
    color: #A855F7;
}

/* ----------------------------------------
   Finance Badges
   ---------------------------------------- */
.finance-badge {
    padding: 5px 12px;
    border-radius: var(--vendorea-radius-sm);
    font-size: 12px;
    font-weight: var(--font-medium);
    border: 1px solid;
    display: inline-block;
}

/* Aging Badges */
.finance-badge-current {
    background: var(--vendorea-success-light);
    border-color: #BBF7D0;
    color: var(--vendorea-success);
}

.finance-badge-1-30 {
    background: var(--vendorea-warning-light);
    border-color: #FDE68A;
    color: #B45309;
}

.finance-badge-31-60 {
    background: #FFF7ED;
    border-color: #FED7AA;
    color: #EA580C;
}

.finance-badge-61-90 {
    background: var(--vendorea-danger-light);
    border-color: #FECACA;
    color: var(--vendorea-danger);
}

.finance-badge-90-plus {
    background: #FEE2E2;
    border-color: #EF4444;
    color: #B91C1C;
}

/* Status Badges */
.finance-badge-open {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-600);
}

.finance-badge-sent {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-600);
}

.finance-badge-partial {
    background: var(--vendorea-info-light);
    border-color: #93C5FD;
    color: var(--vendorea-ar-primary);
}

.finance-badge-paid {
    background: var(--vendorea-success-light);
    border-color: #BBF7D0;
    color: var(--vendorea-success);
}

.finance-badge-overdue {
    background: var(--vendorea-warning-light);
    border-color: #FDE68A;
    color: #B45309;
}

.finance-badge-disputed {
    background: #FAF5FF;
    border-color: #E9D5FF;
    color: #9333EA;
}

.finance-badge-hold {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

/* ----------------------------------------
   Finance Progress Bar
   ---------------------------------------- */
.finance-progress {
    height: 10px;
    border-radius: 5px;
    background: var(--vendorea-border-soft);
    overflow: hidden;
}

.finance-progress-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease;
}

.finance-progress-bar.current { background: var(--vendorea-success); }
.finance-progress-bar.days-1-30 { background: var(--vendorea-warning); }
.finance-progress-bar.days-31-60 { background: #F97316; }
.finance-progress-bar.days-61-90 { background: var(--vendorea-danger); }
.finance-progress-bar.days-90-plus { background: #B91C1C; }

/* ----------------------------------------
   Finance Detail Panel
   ---------------------------------------- */
.finance-detail-card {
    background: var(--vendorea-surface);
    border: 1px solid var(--vendorea-border);
    border-radius: var(--vendorea-radius-xl);
    box-shadow: var(--vendorea-shadow-md);
    overflow: hidden;
}

.finance-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.finance-detail-item {
    padding: var(--space-4);
    background: var(--vendorea-surface);
    border: 1px solid var(--vendorea-border);
    border-radius: var(--vendorea-radius-md);
}

.finance-detail-label {
    font-size: var(--text-sm);
    color: var(--vendorea-muted);
    margin-bottom: var(--space-1);
}

.finance-detail-value {
    font-weight: var(--font-semibold);
    color: var(--vendorea-text);
}

.finance-activity-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--vendorea-border);
    font-size: 14px;
}

.finance-activity-row:last-child {
    border-bottom: none;
}

.finance-activity-label {
    color: var(--vendorea-muted);
}

.finance-activity-value {
    font-weight: var(--font-medium);
    color: var(--vendorea-text);
}

/* ----------------------------------------
   Finance Filter Bar
   ---------------------------------------- */
.finance-filter-bar {
    background: var(--vendorea-panel);
    border-bottom: 1px solid var(--vendorea-border);
    padding: var(--space-4) var(--space-6);
}

@media (min-width: 992px) {
    .finance-filter-bar {
        padding: var(--space-4) var(--space-8);
    }
}

.finance-filter-field label {
    font-size: 12px;
    font-weight: var(--font-medium);
    color: var(--vendorea-muted);
    margin-bottom: var(--space-2);
    display: block;
}

.finance-filter-field .form-control,
.finance-filter-field .form-select {
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--vendorea-border);
    border-radius: var(--vendorea-radius-md);
}

.finance-filter-field .form-control:focus,
.finance-filter-field .form-select:focus {
    border-color: var(--vendorea-ar-primary);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

/* ----------------------------------------
   Finance Empty State
   ---------------------------------------- */
.finance-empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--vendorea-muted);
}

.finance-empty-state i {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    display: block;
}

.finance-empty-state p {
    margin: 0;
}

/* ----------------------------------------
   Finance Stub Feature (Coming Soon)
   ---------------------------------------- */
.finance-stub {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.finance-stub::after {
    content: 'Coming Soon';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    background: var(--vendorea-warning);
    color: var(--vendorea-surface);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* ========================================
   GENERALIZED PAGE COMPONENTS
   Reusable patterns for all modules
   ======================================== */

/* ----------------------------------------
   Page Layout
   ---------------------------------------- */
.page-container {
    background: var(--vendorea-bg);
    min-height: 100vh;
    padding: var(--space-8) 0;
    font-size: 90%; /* Scale content to 90% - affects all rem-based sizes */
}

.page-container .container-fluid {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

@media (min-width: 992px) {
    .page-container .container-fluid {
        padding-left: var(--space-8);
        padding-right: var(--space-8);
    }
}

@media (min-width: 1600px) {
    .page-container .container-fluid {
        max-width: 1800px;
    }
}

/* ----------------------------------------
   Page Card (Base Card)
   ---------------------------------------- */
.page-card {
    background: var(--vendorea-surface);
    border: 1px solid var(--vendorea-border);
    border-radius: var(--vendorea-radius-xl);
    box-shadow: var(--vendorea-shadow-md);
}

.page-card-header {
    background: var(--vendorea-panel);
    border-bottom: 1px solid var(--vendorea-border);
    padding: var(--space-5) var(--space-6);
}

@media (min-width: 992px) {
    .page-card-header {
        padding: var(--space-6) var(--space-8);
    }
}

.page-card-body {
    padding: var(--space-5) var(--space-6);
}

@media (min-width: 992px) {
    .page-card-body {
        padding: var(--space-6) var(--space-8);
    }
}

/* ----------------------------------------
   Page Header Card (Hero Title)
   ---------------------------------------- */
.page-header-card {
    background: var(--vendorea-surface);
    border: 1px solid var(--vendorea-border);
    border-radius: var(--vendorea-radius-xl);
    box-shadow: var(--vendorea-shadow-md);
    overflow: hidden;
    margin-bottom: var(--space-8);
}

.page-header-gradient {
    height: 6px;
    background: var(--vendorea-gradient-header);
}

/* Module-specific gradient colors */
.page-header-gradient.dashboard { background: var(--module-dashboard-gradient); }
.page-header-gradient.orders { background: var(--module-orders-gradient); }
.page-header-gradient.inventory { background: var(--module-inventory-gradient); }
.page-header-gradient.customers { background: var(--module-customers-gradient); }
.page-header-gradient.invoices { background: var(--module-invoices-gradient); }
.page-header-gradient.finance { background: var(--module-finance-gradient); }
.page-header-gradient.settings { background: var(--module-settings-gradient); }
.page-header-gradient.network { background: var(--module-network-gradient); }
.page-header-gradient.reports { background: var(--module-reports-gradient); }
.page-header-gradient.quotes { background: var(--module-quotes-gradient); }
.page-header-gradient.catalog { background: var(--module-catalog-gradient); }
.page-header-gradient.returns { background: var(--module-returns-gradient); }

.page-header-content {
    padding: var(--space-5) var(--space-6);
}

@media (min-width: 992px) {
    .page-header-content {
        padding: var(--space-6) var(--space-8);
    }
}

.page-header-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--vendorea-radius-md);
    color: var(--vendorea-surface);
    font-size: 1.75rem;
    background: var(--vendorea-gradient-primary);
}

/* Module-specific icon backgrounds */
.page-header-icon.dashboard { background: var(--module-dashboard-gradient); }
.page-header-icon.orders { background: var(--module-orders-gradient); }
.page-header-icon.inventory { background: var(--module-inventory-gradient); }
.page-header-icon.customers { background: var(--module-customers-gradient); }
.page-header-icon.invoices { background: var(--module-invoices-gradient); }
.page-header-icon.finance { background: var(--module-finance-gradient); }
.page-header-icon.settings { background: var(--module-settings-gradient); }
.page-header-icon.network { background: var(--module-network-gradient); }
.page-header-icon.reports { background: var(--module-reports-gradient); }
.page-header-icon.quotes { background: var(--module-quotes-gradient); }
.page-header-icon.catalog { background: var(--module-catalog-gradient); }
.page-header-icon.returns { background: var(--module-returns-gradient); }

.page-header-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-1);
    color: var(--vendorea-blue);
}

/* Module-specific label colors */
.page-header-label.dashboard { color: var(--module-dashboard); }
.page-header-label.orders { color: var(--module-orders); }
.page-header-label.inventory { color: var(--module-inventory); }
.page-header-label.customers { color: var(--module-customers); }
.page-header-label.invoices { color: var(--module-invoices); }
.page-header-label.finance { color: var(--module-finance); }
.page-header-label.settings { color: var(--module-settings); }
.page-header-label.network { color: var(--module-network); }
.page-header-label.reports { color: var(--module-reports); }
.page-header-label.quotes { color: var(--module-quotes); }
.page-header-label.catalog { color: var(--module-catalog); }
.page-header-label.returns { color: var(--module-returns); }

.page-header-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    color: var(--vendorea-text);
    margin: 0;
}

.page-header-description {
    color: var(--vendorea-muted);
    font-size: 15px;
    line-height: 1.6;
    max-width: 550px;
    margin: 0;
}

/* ----------------------------------------
   Daily Briefing Card
   ---------------------------------------- */
.daily-briefing-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 50%, #fde68a 100%);
    border: 1px solid #fcd34d;
    border-radius: var(--vendorea-radius-xl);
    box-shadow: var(--vendorea-shadow-md);
    padding: var(--space-6);
    position: relative;
    overflow: hidden;
}

.daily-briefing-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at top right, rgba(251, 191, 36, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.daily-briefing-card h5 {
    color: #92400e;
}

.briefing-content p {
    color: #78350f;
}

.briefing-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.briefing-chip:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.briefing-chip i {
    color: var(--chip-color, var(--vendorea-blue));
    font-size: 14px;
}

/* Collapsible content */
.briefing-expandable-content {
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
    overflow: hidden;
}

.daily-briefing-card.collapsed {
    padding: var(--space-4);
}

.daily-briefing-card.collapsed .briefing-expandable-content {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

/* Mini chips for collapsed state */
.briefing-collapsed-chips {
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.briefing-chip-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
}

.briefing-chip-mini i {
    color: var(--chip-color, var(--vendorea-blue));
    font-size: 11px;
}

/* Toggle button */
.briefing-toggle {
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.briefing-toggle:hover {
    opacity: 1;
}

.briefing-toggle i {
    transition: transform 0.3s ease;
}

/* Dark/alternate briefing styles for different states */
.daily-briefing-card.pressure {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 50%, #fecaca 100%);
    border-color: #fca5a5;
}

.daily-briefing-card.pressure h5,
.daily-briefing-card.pressure .briefing-content p {
    color: #991b1b;
}

.daily-briefing-card.momentum {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%);
    border-color: #6ee7b7;
}

.daily-briefing-card.momentum h5,
.daily-briefing-card.momentum .briefing-content p {
    color: #065f46;
}

/* ----------------------------------------
   Summary Cards (KPI Cards)
   ---------------------------------------- */
.summary-card {
    display: block;
    background: var(--vendorea-surface);
    border: 1px solid var(--vendorea-border);
    border-radius: var(--vendorea-radius-xl);
    box-shadow: var(--vendorea-shadow-sm);
    padding: var(--space-5);
    min-height: 140px;
    transition: all 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--vendorea-shadow-lg);
}

.summary-card.active {
    border-color: var(--vendorea-blue);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15), var(--vendorea-shadow-md);
}

@media (min-width: 1400px) {
    .summary-card {
        min-height: 160px;
        padding: var(--space-6);
    }
}

.summary-label {
    font-weight: var(--font-medium);
    color: var(--vendorea-muted);
    margin-bottom: var(--space-3);
}

.summary-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-semibold);
    color: var(--vendorea-text);
    margin-bottom: var(--space-3);
}

@media (min-width: 1400px) {
    .summary-value {
        font-size: 2rem;
    }
}

.summary-meta {
    font-size: var(--text-sm);
    color: var(--vendorea-muted);
}

.summary-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.summary-trend {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
}

.summary-trend.up {
    background: var(--vendorea-success-light);
    color: var(--vendorea-success);
}

.summary-trend.down {
    background: var(--vendorea-danger-light);
    color: var(--vendorea-danger);
}

.summary-trend.neutral {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ----------------------------------------
   Data Table
   ---------------------------------------- */
.data-table {
    width: 100%;
    margin-bottom: 0;
}

.data-table thead {
    background: var(--vendorea-surface);
    border-bottom: 1px solid var(--vendorea-border);
}

.data-table th {
    font-size: 11px;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--vendorea-muted);
    padding: var(--space-4) var(--space-5) !important;
    white-space: nowrap;
}

.data-table td {
    padding: var(--space-4) var(--space-5) !important;
    vertical-align: middle;
    color: var(--vendorea-text);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--vendorea-border-soft);
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background-color: var(--vendorea-panel);
}

.data-table tbody tr.selected {
    background-color: var(--vendorea-info-light);
}

.data-table-link {
    color: var(--vendorea-blue);
    font-weight: var(--font-semibold);
    text-decoration: none;
}

.data-table-link:hover {
    color: var(--vendorea-blue-light);
}

/* Sortable Table Headers */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding: 0 !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.data-table th.sortable > a {
    display: block;
    padding: var(--space-4) var(--space-5);
    padding-right: 24px;
    color: inherit;
    text-decoration: none;
}

.data-table th.sortable:hover {
    background-color: var(--vendorea-info-light);
}

.data-table th.sortable:hover > a {
    color: var(--vendorea-blue);
}

.data-table th.sortable::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid var(--vendorea-muted);
    opacity: 0.3;
    margin-top: -3px;
}

.data-table th.sortable::before {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--vendorea-muted);
    opacity: 0.3;
    margin-top: 3px;
}

.data-table th.sortable.sorted-asc,
.data-table th.sortable.sorted-desc {
    background-color: var(--vendorea-info-light);
    color: var(--vendorea-blue);
}

.data-table th.sortable.sorted-asc::after {
    border-bottom-color: var(--vendorea-blue);
    opacity: 1;
}

.data-table th.sortable.sorted-asc::before {
    opacity: 0;
}

.data-table th.sortable.sorted-desc::before {
    border-top-color: var(--vendorea-blue);
    opacity: 1;
}

.data-table th.sortable.sorted-desc::after {
    opacity: 0;
}

/* Right-aligned sortable headers */
.data-table th.sortable.text-end > a {
    padding-left: 24px;
    padding-right: var(--space-5);
    text-align: right;
}

.data-table th.sortable.text-end::after,
.data-table th.sortable.text-end::before {
    right: auto;
    left: 8px;
}

/* Center-aligned sortable headers */
.data-table th.sortable.text-center > a {
    padding-left: 16px;
    padding-right: 24px;
    text-align: center;
}

/* ----------------------------------------
   Filter Bar
   ---------------------------------------- */
.filter-bar {
    background: var(--vendorea-panel);
    border-bottom: 1px solid var(--vendorea-border);
    padding: var(--space-4) var(--space-6);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

@media (min-width: 992px) {
    .filter-bar {
        padding: var(--space-4) var(--space-8);
    }
}

/* Filter field with search icon */
.filter-field {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.filter-field > i {
    position: absolute;
    left: 12px;
    color: var(--vendorea-muted);
    font-size: 14px;
    pointer-events: none;
}

.filter-field > input {
    padding-left: 36px !important;
}

.filter-field label {
    font-size: 12px;
    font-weight: var(--font-medium);
    color: var(--vendorea-muted);
    margin-bottom: var(--space-2);
    display: block;
}

.filter-field .form-control,
.filter-field .form-select {
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--vendorea-border);
    border-radius: var(--vendorea-radius-md);
}

.filter-field .form-control:focus,
.filter-field .form-select:focus {
    border-color: var(--vendorea-blue);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

/* Quick Filter Buttons */
.btn-filter-active {
    background: var(--vendorea-info-light);
    color: var(--vendorea-blue);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--vendorea-radius-md);
    font-weight: var(--font-medium);
}

.btn-filter-active:hover {
    background: #BFDBFE;
    color: var(--vendorea-blue);
}

/* Module-specific filter active states */
.btn-filter-active.inventory { background: var(--module-inventory-light); color: var(--module-inventory); }
.btn-filter-active.customers { background: var(--module-customers-light); color: var(--module-customers); }
.btn-filter-active.invoices { background: var(--module-invoices-light); color: var(--module-invoices); }
.btn-filter-active.settings { background: var(--module-settings-light); color: var(--module-settings); }
.btn-filter-active.network { background: var(--module-network-light); color: var(--module-network); }
.btn-filter-active.reports { background: var(--module-reports-light); color: var(--module-reports); }

/* ----------------------------------------
   Detail Panel
   ---------------------------------------- */
.detail-card {
    background: var(--vendorea-surface);
    border: 1px solid var(--vendorea-border);
    border-radius: var(--vendorea-radius-xl);
    box-shadow: var(--vendorea-shadow-md);
    overflow: hidden;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.detail-item {
    padding: var(--space-4);
    background: var(--vendorea-surface);
    border: 1px solid var(--vendorea-border);
    border-radius: var(--vendorea-radius-md);
}

.detail-label {
    font-size: var(--text-sm);
    color: var(--vendorea-muted);
    margin-bottom: var(--space-1);
}

.detail-value {
    font-weight: var(--font-semibold);
    color: var(--vendorea-text);
}

.activity-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--vendorea-border);
    font-size: 14px;
}

.activity-row:last-child {
    border-bottom: none;
}

.activity-label {
    color: var(--vendorea-muted);
}

.activity-value {
    font-weight: var(--font-medium);
    color: var(--vendorea-text);
}

/* ----------------------------------------
   Status Badges (Generalized)
   ---------------------------------------- */
.status-badge {
    padding: 5px 12px;
    border-radius: var(--vendorea-radius-sm);
    font-size: 12px;
    font-weight: var(--font-medium);
    border: 1px solid;
    display: inline-block;
}

/* General Status Badges */
.status-badge-pending {
    background: var(--vendorea-warning-light);
    border-color: #FDE68A;
    color: #B45309;
}

.status-badge-active,
.status-badge-approved,
.status-badge-completed,
.status-badge-success,
.status-badge-credit {
    background: var(--vendorea-success-light);
    border-color: #BBF7D0;
    color: var(--vendorea-success);
}

.status-badge-inactive,
.status-badge-cancelled,
.status-badge-rejected {
    background: var(--vendorea-danger-light);
    border-color: #FECACA;
    color: var(--vendorea-danger);
}

.status-badge-draft,
.status-badge-new {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-600);
}

.status-badge-processing,
.status-badge-in-progress {
    background: var(--vendorea-info-light);
    border-color: #93C5FD;
    color: var(--vendorea-blue);
}

.status-badge-shipped,
.status-badge-delivered {
    background: #CCFBF1;
    border-color: #5EEAD4;
    color: #0D9488;
}

.status-badge-on-hold {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

.status-badge-urgent,
.status-badge-critical {
    background: #FEE2E2;
    border-color: #EF4444;
    color: #B91C1C;
}

.status-badge-warning,
.status-badge-due-soon {
    background: #FEF3C7;
    border-color: #F59E0B;
    color: #B45309;
}

.status-badge-promise,
.status-badge-promise-to-pay {
    background: #FEF9C3;
    border-color: #FACC15;
    color: #A16207;
}

/* Invoice Status Badges */
.status-badge-paid {
    background: #D1FAE5;
    border-color: #34D399;
    color: #059669;
}

.status-badge-partial {
    background: #E0E7FF;
    border-color: #818CF8;
    color: #4338CA;
}

.status-badge-overdue {
    background: #FEE2E2;
    border-color: #F87171;
    color: #DC2626;
}

.status-badge-closed {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-600);
}

/* Credit Memo Status Badges */
.status-badge-issued {
    background: #EDE9FE;
    border-color: #A78BFA;
    color: #7C3AED;
}

.status-badge-applied {
    background: #D1FAE5;
    border-color: #6EE7B7;
    color: #059669;
}

/* Credit Memo Indicators */
.text-purple {
    color: #7C3AED !important;
}

.bg-purple-subtle {
    background-color: #EDE9FE !important;
}

.badge.bg-purple-subtle.text-purple {
    color: #7C3AED !important;
}

/* ----------------------------------------
   Page Empty State
   ---------------------------------------- */
.page-empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--vendorea-muted);
}

.page-empty-state i {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    display: block;
}

.page-empty-state h5 {
    font-weight: var(--font-semibold);
    color: var(--vendorea-text);
    margin-bottom: var(--space-2);
}

.page-empty-state p {
    margin: 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ----------------------------------------
   Module Primary Buttons
   ---------------------------------------- */
.btn-module-primary {
    background: var(--vendorea-gradient-primary);
    color: var(--vendorea-surface);
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--vendorea-radius-md);
    font-weight: var(--font-medium);
    transition: all 0.2s ease;
}

.btn-module-primary:hover {
    opacity: 0.95;
    color: var(--vendorea-surface);
}

/* Module-specific button variants */
.btn-module-primary.dashboard { background: var(--module-dashboard-gradient); }
.btn-module-primary.orders { background: var(--module-orders-gradient); }
.btn-module-primary.inventory { background: var(--module-inventory-gradient); }
.btn-module-primary.customers { background: var(--module-customers-gradient); }
.btn-module-primary.invoices { background: var(--module-invoices-gradient); }
.btn-module-primary.finance { background: var(--module-finance-gradient); }
.btn-module-primary.settings { background: var(--module-settings-gradient); }
.btn-module-primary.network { background: var(--module-network-gradient); }
.btn-module-primary.reports { background: var(--module-reports-gradient); }
.btn-module-primary.quotes { background: var(--module-quotes-gradient); }
.btn-module-primary.catalog { background: var(--module-catalog-gradient); }

.btn-module-secondary {
    background: var(--vendorea-info-light);
    color: var(--vendorea-blue);
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--vendorea-radius-md);
    font-weight: var(--font-medium);
    transition: all 0.2s ease;
}

.btn-module-secondary:hover {
    background: #BFDBFE;
    color: var(--vendorea-blue);
}

/* Module-specific secondary buttons */
.btn-module-secondary.inventory { background: var(--module-inventory-light); color: var(--module-inventory); }
.btn-module-secondary.customers { background: var(--module-customers-light); color: var(--module-customers); }
.btn-module-secondary.invoices { background: var(--module-invoices-light); color: var(--module-invoices); }

/* ----------------------------------------
   Progress Bar (Generalized)
   ---------------------------------------- */
.progress-bar-track {
    height: 10px;
    border-radius: 5px;
    background: var(--vendorea-border-soft);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease;
    background: var(--vendorea-blue);
}

.progress-bar-fill.success { background: var(--vendorea-success); }
.progress-bar-fill.warning { background: var(--vendorea-warning); }
.progress-bar-fill.danger { background: var(--vendorea-danger); }
.progress-bar-fill.info { background: var(--vendorea-cyan); }

/* ----------------------------------------
   Feature Stub (Coming Soon)
   ---------------------------------------- */
.feature-stub {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.feature-stub::after {
    content: 'Coming Soon';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    background: var(--vendorea-warning);
    color: var(--vendorea-surface);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* ----------------------------------------
   Activity Feed
   ---------------------------------------- */
.activity-feed {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-feed-item {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--vendorea-border-soft);
}

.activity-feed-item:last-child {
    border-bottom: none;
}

.activity-feed-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--vendorea-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.activity-feed-icon.primary { background: var(--vendorea-info-light); color: var(--vendorea-blue); }
.activity-feed-icon.success { background: var(--vendorea-success-light); color: var(--vendorea-success); }
.activity-feed-icon.warning { background: var(--vendorea-warning-light); color: var(--vendorea-warning); }
.activity-feed-icon.danger { background: var(--vendorea-danger-light); color: var(--vendorea-danger); }
.activity-feed-icon.info { background: var(--vendorea-info-light); color: var(--vendorea-info); }
.activity-feed-icon.secondary { background: var(--gray-100); color: var(--gray-500); }

.activity-feed-content {
    flex: 1;
    min-width: 0;
}

.activity-feed-title {
    font-weight: var(--font-medium);
    color: var(--vendorea-text);
    margin-bottom: var(--space-1);
}

.activity-feed-text {
    font-size: var(--text-sm);
    color: var(--vendorea-muted);
    margin: 0;
}

.activity-feed-time {
    font-size: var(--text-xs);
    color: var(--vendorea-soft);
}

/* ----------------------------------------
   Quick Actions Grid
   ---------------------------------------- */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-4);
}

.quick-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-5);
    background: var(--vendorea-surface);
    border: 1px solid var(--vendorea-border);
    border-radius: var(--vendorea-radius-lg);
    text-decoration: none;
    color: var(--vendorea-text);
    transition: all 0.2s ease;
}

.quick-action-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--vendorea-shadow-md);
    border-color: var(--vendorea-blue);
    color: var(--vendorea-blue);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--vendorea-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--vendorea-panel);
    color: var(--vendorea-muted);
    transition: all 0.2s ease;
}

.quick-action-item:hover .quick-action-icon {
    background: var(--vendorea-info-light);
    color: var(--vendorea-blue);
}

.quick-action-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    text-align: center;
}

/* ----------------------------------------
   Alerts Panel
   ---------------------------------------- */
.alerts-panel {
    background: var(--vendorea-surface);
    border: 1px solid var(--vendorea-border);
    border-radius: var(--vendorea-radius-xl);
    overflow: hidden;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--vendorea-border-soft);
}

.alert-item:last-child {
    border-bottom: none;
}

.alert-item.warning {
    background: var(--vendorea-warning-light);
}

.alert-item.danger {
    background: var(--vendorea-danger-light);
}

.alert-item-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
}

.alert-item.warning .alert-item-icon { color: var(--vendorea-warning); }
.alert-item.danger .alert-item-icon { color: var(--vendorea-danger); }

.alert-item-content {
    flex: 1;
    min-width: 0;
}

.alert-item-title {
    font-weight: var(--font-medium);
    color: var(--vendorea-text);
    margin-bottom: var(--space-1);
}

.alert-item-text {
    font-size: var(--text-sm);
    color: var(--vendorea-muted);
    margin: 0;
}
