/**
 * WholesaleRex - Centralized Theme CSS
 *
 * Adventure/Jungle T-Rex brand identity
 * - Primary: Mahogany/Saddle Leather (warm red-brown)
 * - Accent: Burnt Sienna/Campfire (vibrant action)
 * - Secondary: Moss/Forest (earthy green)
 * - Highlight: Sunlit Gold (premium warmth)
 * - Background: Warm Cream/Bone (alive, not gray)
 *
 * Color philosophy: Woodsy, jungle, leather, campfire, adventure gear
 * NOT: Muddy, gray-brown, dull, fecal tones
 */

/* ==========================================================================
   CSS VARIABLES
   ========================================================================== */

:root {
    /* Primary palette - Rich Oxblood/Cognac Leather (warm, saturated red-brown) */
    --rex-primary: #7B4B3A;
    --rex-primary-dark: #5C3A2E;
    --rex-primary-light: #A67C6D;

    /* Primary with warmth boost - for gradients */
    --rex-primary-warm: #8B5342;
    --rex-primary-highlight: #9D6B5A;

    /* Accent colors - Burnt Sienna/Campfire (vibrant warmth) */
    --rex-accent: #D84315;
    --rex-accent-dark: #BF360C;
    --rex-accent-light: #FF5722;

    /* Secondary - Moss/Forest Green (earthy, alive) */
    --rex-moss: #558B2F;
    --rex-moss-dark: #33691E;
    --rex-moss-light: #7CB342;

    /* Highlight - Sunlit Gold (warm, premium) */
    --rex-gold: #D4A017;
    --rex-gold-dark: #B8860B;
    --rex-gold-light: #F5C518;

    /* Status colors - warmer variants */
    --rex-success: #43A047;
    --rex-success-light: #E8F5E9;
    --rex-warning: #EF6C00;
    --rex-warning-light: #FFF3E0;
    --rex-error: #C62828;
    --rex-error-light: #FFEBEE;
    --rex-info: #1976D2;
    --rex-info-light: #E3F2FD;

    /* Neutrals - Warm Cream/Bone (alive, not gray) */
    --rex-bg: #FFFBF5;
    --rex-bg-alt: #FDF6ED;
    --rex-card: #FFFFFF;
    --rex-border: #E8DFD3;
    --rex-text: #4A3728;
    --rex-text-light: #6D4C41;
    --rex-muted: #9C786C;

    /* Shadows - Warm amber undertones */
    --rex-shadow-sm: 0 1px 2px rgba(74,55,40,0.08);
    --rex-shadow: 0 2px 8px rgba(74,55,40,0.10);
    --rex-shadow-lg: 0 4px 20px rgba(74,55,40,0.14);
    --rex-shadow-hover: 0 8px 30px rgba(74,55,40,0.18);

    /* Radii */
    --rex-radius-sm: 4px;
    --rex-radius: 8px;
    --rex-radius-lg: 12px;
    --rex-radius-xl: 16px;

    /* Transitions */
    --rex-transition: 0.2s ease;
    --rex-transition-slow: 0.3s ease;

    /* Typography */
    --rex-font-display: 'Georgia', serif;
    --rex-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Texture overlay - subtle leather grain (3% opacity) */
    --rex-texture: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");

    /* Wood grain texture - for header/footer (visible but not distracting) */
    --rex-wood-grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.02 0.08' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='0.06'/%3E%3C/svg%3E");

    /* Additional wood knot/variation texture */
    --rex-wood-knots: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='knots'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.015 0.04' numOctaves='2' seed='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23knots)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */

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

body {
    font-family: var(--rex-font-body);
    background: var(--rex-bg);
    color: var(--rex-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    background-image: var(--rex-texture);
}

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

a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   HEADER - Rich wood plank / leather satchel feel
   ========================================================================== */

.rex-header {
    /*
     * Lodge Sign Test: DRAMATICALLY warmer - unmistakable change
     * Rich wood plank with visible grain bands
     */
    background:
        /* Horizontal wood grain bands - subtle but visible */
        repeating-linear-gradient(
            180deg,
            rgba(0,0,0,0.06) 0px,
            rgba(0,0,0,0.03) 1px,
            transparent 2px,
            transparent 6px,
            rgba(0,0,0,0.04) 7px,
            rgba(0,0,0,0.02) 8px,
            transparent 9px,
            transparent 14px
        ),
        /* Top highlight - bright carved bevel edge */
        linear-gradient(180deg,
            rgba(255,200,150,0.35) 0%,
            rgba(255,180,130,0.15) 4%,
            transparent 8%
        ),
        /* Main wood gradient - VERY WARM amber/cognac */
        linear-gradient(180deg,
            #A06A50 0%,       /* Bright warm amber top */
            #8B5A42 15%,      /* Rich honey-cognac */
            #7A4D38 35%,      /* Warm mahogany */
            #68422F 55%,      /* Heartwood */
            #573626 75%,      /* Deep walnut */
            #452C1E 100%      /* Dark base */
        );
    color: white;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    /* Strong dimensional shadows - wood plank depth */
    box-shadow:
        /* Inner top light - carved highlight */
        inset 0 3px 0 rgba(255,220,180,0.25),
        inset 0 1px 0 rgba(255,255,255,0.1),
        /* Inner bottom shadow - thickness groove */
        inset 0 -3px 0 rgba(20,10,0,0.5),
        /* Outer drop shadow - floating above page */
        0 8px 30px rgba(30,15,5,0.6),
        0 4px 12px rgba(40,20,10,0.4);
    border-bottom: 4px solid var(--rex-gold);
}

.rex-header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 68px;
}

.rex-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 22px;
    font-family: var(--rex-font-display);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.rex-logo:hover {
    text-decoration: none;
    opacity: 0.95;
}

.rex-logo img {
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
    border-radius: 4px;
}

.rex-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.rex-logo-brand {
    font-size: 20px;
    letter-spacing: 0.5px;
}

.rex-logo-brand .rex-caps {
    text-transform: uppercase;
}

.rex-nav {
    display: flex;
    gap: 6px;
}

.rex-nav-link {
    color: rgba(255,255,255,0.85);
    padding: 10px 18px;
    border-radius: var(--rex-radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--rex-transition);
    border: 2px solid transparent;
}

.rex-nav-link:hover {
    background: rgba(255,255,255,0.12);
    color: white;
    text-decoration: none;
    border-color: rgba(255,255,255,0.2);
}

.rex-nav-link.active {
    background: linear-gradient(135deg, var(--rex-gold-dark), var(--rex-gold));
    color: #3E2723;
    font-weight: 700;
    border-color: var(--rex-gold-light);
    box-shadow: 0 2px 8px rgba(212,160,23,0.4);
}

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

.rex-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255,255,255,0.9);
}

.rex-logout-btn {
    background: rgba(0,0,0,0.2);
    border: 2px solid rgba(255,255,255,0.25);
    color: white;
    padding: 8px 16px;
    border-radius: var(--rex-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--rex-transition);
}

.rex-logout-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
}

/* Notification Bell */
.rex-notification-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    text-decoration: none;
    transition: all var(--rex-transition);
}

.rex-notification-bell:hover {
    background: rgba(255,255,255,0.2);
    text-decoration: none;
}

.rex-notification-bell.active {
    background: rgba(255,255,255,0.25);
}

.rex-bell-icon {
    font-size: 20px;
    line-height: 1;
}

.rex-notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--rex-error);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--rex-primary-dark);
    animation: rex-badge-pulse 2s ease-in-out infinite;
}

@keyframes rex-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.rex-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.rex-container-sm {
    max-width: 800px;
}

.rex-container-lg {
    max-width: 1400px;
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.rex-card {
    background: var(--rex-card);
    border-radius: var(--rex-radius-lg);
    box-shadow: var(--rex-shadow);
    border: 1px solid var(--rex-border);
    overflow: hidden;
}

.rex-card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--rex-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rex-card-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    font-family: var(--rex-font-display);
    color: var(--rex-primary-dark);
}

.rex-card-body {
    padding: 25px;
}

.rex-card-gold-top {
    border-top: 4px solid var(--rex-gold);
}

.rex-card-hover {
    transition: all 0.25s ease;
    border: 2px solid transparent;
}

.rex-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--rex-shadow-hover);
    border-color: var(--rex-gold);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.rex-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--rex-radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--rex-transition);
}

.rex-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.rex-btn-primary {
    background: linear-gradient(135deg, var(--rex-accent), var(--rex-accent-light));
    color: white;
    box-shadow: 0 4px 15px rgba(191,54,12,0.3);
}

.rex-btn-primary:hover {
    background: linear-gradient(135deg, var(--rex-accent-dark), var(--rex-accent));
    box-shadow: 0 6px 20px rgba(191,54,12,0.4);
}

.rex-btn-secondary {
    background: var(--rex-primary);
    color: white;
}

.rex-btn-secondary:hover {
    background: var(--rex-primary-dark);
}

.rex-btn-outline {
    background: transparent;
    color: var(--rex-primary);
    border: 2px solid var(--rex-primary);
}

.rex-btn-outline:hover {
    background: var(--rex-primary);
    color: white;
}

.rex-btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.rex-btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* ==========================================================================
   BADGES
   ========================================================================== */

.rex-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

/* Status badges */
.rex-badge-draft {
    background: var(--rex-warning-light);
    color: var(--rex-warning);
}

.rex-badge-active {
    background: var(--rex-success-light);
    color: var(--rex-success);
}

.rex-badge-closed,
.rex-badge-sold {
    background: #f3e5f5;
    color: #7b1fa2;
}

.rex-badge-scheduled {
    background: #F3E5F5;
    color: #7B1FA2;
}

.rex-badge-new {
    background: linear-gradient(135deg, var(--rex-accent), var(--rex-accent-light));
    color: white;
}

.rex-badge-own {
    background: var(--rex-primary);
    color: white;
}

/* Admin badge */
.rex-badge-admin {
    background: var(--rex-gold);
    color: var(--rex-primary-dark);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

/* Tier badges */
.rex-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
}

.rex-tier-bronze {
    background: linear-gradient(135deg, #EFEBE9, #D7CCC8);
    color: #6D4C41;
    border: 1px solid #BCAAA4;
}

.rex-tier-silver {
    background: linear-gradient(135deg, #F5F5F5, #E0E0E0);
    color: #616161;
    border: 1px solid #BDBDBD;
}

.rex-tier-gold {
    background: linear-gradient(135deg, #FFF8E1, #FFD54F);
    color: #5D4037;
    border: 1px solid #FFB300;
}

.rex-tier-platinum {
    background: linear-gradient(135deg, #E1F5FE, #81D4FA);
    color: #01579B;
    border: 1px solid #4FC3F7;
}

/* Credibility score badges */
.rex-cred-high {
    background: linear-gradient(135deg, var(--rex-gold), var(--rex-gold-light));
    color: #4A3728;
}

.rex-cred-medium {
    background: linear-gradient(135deg, var(--rex-primary), var(--rex-primary-light));
    color: white;
}

.rex-cred-low {
    background: var(--rex-bg-alt);
    color: var(--rex-muted);
    border: 1px solid var(--rex-border);
}

/* ==========================================================================
   CONFIDENCE INDICATORS
   ========================================================================== */

.rex-confidence {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.rex-confidence-high {
    background: var(--rex-success-light);
    color: var(--rex-success);
    border: 1px solid #A5D6A7;
}

.rex-confidence-medium {
    background: var(--rex-warning-light);
    color: var(--rex-warning);
    border: 1px solid #FFCC80;
}

.rex-confidence-low {
    background: var(--rex-bg-alt);
    color: var(--rex-muted);
    border: 1px solid var(--rex-border);
}

/* ==========================================================================
   DEAL TAGS
   ========================================================================== */

.rex-deal-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--rex-radius);
    font-size: 13px;
    font-weight: 600;
}

.rex-deal-tag-cash {
    background: #E8F5E9;
    color: #2E7D32;
}

.rex-deal-tag-sub2 {
    background: #E3F2FD;
    color: #1565C0;
}

.rex-deal-tag-wrap {
    background: #FFF3E0;
    color: #E65100;
}

/* ==========================================================================
   ALERTS / FLASH MESSAGES
   ========================================================================== */

.rex-alert {
    padding: 14px 18px;
    border-radius: var(--rex-radius);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rex-alert-success {
    background: var(--rex-success-light);
    color: var(--rex-success);
    border-left: 4px solid var(--rex-success);
}

.rex-alert-warning {
    background: var(--rex-warning-light);
    color: var(--rex-warning);
    border-left: 4px solid var(--rex-warning);
}

.rex-alert-error {
    background: var(--rex-error-light);
    color: var(--rex-error);
    border-left: 4px solid var(--rex-error);
}

.rex-alert-info {
    background: var(--rex-info-light);
    color: var(--rex-info);
    border-left: 4px solid var(--rex-info);
}

/* ==========================================================================
   EMPTY STATES
   ========================================================================== */

.rex-empty-state {
    text-align: center;
    padding: 60px 30px;
    background: var(--rex-card);
    border-radius: var(--rex-radius-lg);
    box-shadow: var(--rex-shadow);
}

.rex-empty-mascot {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.rex-empty-title {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--rex-text);
    font-family: var(--rex-font-display);
}

.rex-empty-text {
    color: var(--rex-muted);
    max-width: 400px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.rex-empty-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--rex-accent);
    font-weight: 600;
    transition: all var(--rex-transition);
}

.rex-empty-link:hover {
    color: var(--rex-accent-dark);
    text-decoration: none;
}

/* ==========================================================================
   STATS
   ========================================================================== */

.rex-stats-bar {
    display: flex;
    gap: 24px;
    padding: 20px 28px;
    background: var(--rex-card);
    border-radius: var(--rex-radius-lg);
    box-shadow: var(--rex-shadow);
    flex-wrap: wrap;
    border-top: 3px solid var(--rex-gold);
}

.rex-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rex-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--rex-bg-alt);
}

.rex-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--rex-primary);
    font-family: var(--rex-font-display);
}

.rex-stat-label {
    font-size: 12px;
    color: var(--rex-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rex-stat-divider {
    width: 1px;
    background: var(--rex-border);
}

/* ==========================================================================
   LISTING CARDS (Marketplace)
   ========================================================================== */

.rex-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.rex-listing-card {
    background: var(--rex-card);
    border-radius: var(--rex-radius-lg);
    box-shadow: var(--rex-shadow);
    padding: 0;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.25s ease;
    border: 2px solid transparent;
    overflow: hidden;
}

.rex-listing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--rex-shadow-hover);
    border-color: var(--rex-gold);
    text-decoration: none;
}

.rex-listing-card-body {
    padding: 20px;
}

.rex-listing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.rex-listing-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--rex-primary);
    font-family: var(--rex-font-display);
}

.rex-listing-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.rex-listing-address {
    font-size: 16px;
    font-weight: 600;
    color: var(--rex-text);
    margin-bottom: 4px;
}

.rex-listing-location {
    font-size: 14px;
    color: var(--rex-muted);
    margin-bottom: 15px;
}

.rex-listing-details {
    display: flex;
    gap: 20px;
    padding-top: 12px;
    border-top: 1px solid var(--rex-border);
}

.rex-listing-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rex-listing-detail-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--rex-text);
}

.rex-listing-detail-label {
    font-size: 11px;
    color: var(--rex-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   PAGE TITLES
   ========================================================================== */

.rex-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.rex-page-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rex-page-title h1 {
    font-family: var(--rex-font-display);
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    color: var(--rex-primary-dark);
}

.rex-page-title-icon {
    font-size: 32px;
}

/* ==========================================================================
   TIER INFO BOX
   ========================================================================== */

.rex-tier-info {
    font-size: 13px;
    color: var(--rex-text-light);
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--rex-bg-alt);
    border-radius: var(--rex-radius);
    border-left: 4px solid var(--rex-gold);
}

.rex-tier-info a {
    color: var(--rex-accent);
    font-weight: 600;
}

.rex-tier-info a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   SORT CONTROLS
   ========================================================================== */

.rex-sort-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
}

.rex-sort-label {
    font-size: 13px;
    color: var(--rex-muted);
    margin-right: 8px;
    font-weight: 500;
}

.rex-sort-btn {
    padding: 8px 14px;
    border: 2px solid var(--rex-border);
    border-radius: var(--rex-radius);
    background: var(--rex-card);
    color: var(--rex-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--rex-transition);
}

.rex-sort-btn:hover {
    border-color: var(--rex-primary);
    color: var(--rex-primary);
    text-decoration: none;
}

.rex-sort-btn.active {
    background: var(--rex-primary);
    color: white;
    border-color: var(--rex-primary);
}

/* ==========================================================================
   FOOTER - Universal branded footer (matching header wood feel)
   ========================================================================== */

.rex-footer {
    /*
     * Lodge Sign Test: DRAMATICALLY warmer - shadow-side plank
     * Matches header's visible warmth but deeper tones
     */
    background:
        /* Horizontal wood grain bands - subtle but visible */
        repeating-linear-gradient(
            180deg,
            rgba(0,0,0,0.06) 0px,
            rgba(0,0,0,0.03) 1px,
            transparent 2px,
            transparent 6px,
            rgba(0,0,0,0.04) 7px,
            rgba(0,0,0,0.02) 8px,
            transparent 9px,
            transparent 14px
        ),
        /* Top highlight - worn polished edge */
        linear-gradient(180deg,
            rgba(255,200,150,0.2) 0%,
            rgba(255,180,130,0.08) 3%,
            transparent 6%
        ),
        /* Main wood gradient - warm but shadowed */
        linear-gradient(180deg,
            #6B4A3A 0%,       /* Warm brown top edge */
            #5C3D30 15%,      /* Cognac shadow */
            #4D3326 35%,      /* Dark mahogany */
            #3E2518 60%,      /* Deep wood */
            #301C12 100%      /* Dark base */
        );
    color: rgba(255,255,255,0.9);
    padding: 35px 30px;
    margin-top: 50px;
    border-top: 4px solid var(--rex-gold);
    /* Strong dimensional shadows - wood plank depth */
    box-shadow:
        /* Inner top light - worn edge highlight */
        inset 0 3px 0 rgba(255,200,150,0.15),
        inset 0 1px 0 rgba(255,255,255,0.05),
        /* Inner depth shadow - carved inward */
        inset 0 10px 30px rgba(0,0,0,0.3),
        /* Ambient glow upward */
        inset 0 -15px 40px rgba(100,60,35,0.15);
}

.rex-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.rex-footer-mascot {
    flex-shrink: 0;
}

.rex-footer-mascot img {
    height: 100px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.rex-footer-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rex-footer-line1 {
    font-size: 16px;
    font-weight: 600;
    color: white;
    font-family: var(--rex-font-display);
    letter-spacing: 0.5px;
}

.rex-footer-line2 {
    font-size: 14px;
    color: var(--rex-gold-light);
    font-style: italic;
}

.rex-footer-line3 {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}

.rex-footer-powered {
    font-size: 13px;
    color: var(--rex-gold);
    margin-top: 6px;
    font-weight: 500;
}

.rex-footer-powered a {
    color: var(--rex-gold-light);
    text-decoration: none;
}

.rex-footer-powered a:hover {
    text-decoration: underline;
    color: #fff;
}

/* Legacy footer support */
.rex-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--rex-gold);
    font-weight: 600;
}

@media (max-width: 600px) {
    .rex-footer-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .rex-footer-mascot img {
        height: 80px;
        width: auto;
    }
}

/* ==========================================================================
   FORMS
   ========================================================================== */

.rex-form-group {
    margin-bottom: 20px;
}

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

.rex-form-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--rex-border);
    border-radius: var(--rex-radius);
    font-size: 14px;
    transition: border-color var(--rex-transition);
}

.rex-form-input:focus {
    outline: none;
    border-color: var(--rex-primary);
}

.rex-form-hint {
    font-size: 12px;
    color: var(--rex-muted);
    margin-top: 6px;
}

/* Checkbox styling for deal structure */
.rex-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.rex-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--rex-bg-alt);
    border-radius: var(--rex-radius);
    cursor: pointer;
    transition: all var(--rex-transition);
    border: 2px solid transparent;
}

.rex-checkbox-label:hover {
    background: var(--rex-bg);
    border-color: var(--rex-primary-light);
}

.rex-checkbox-label input:checked + span {
    color: var(--rex-primary);
    font-weight: 600;
}

/* ==========================================================================
   DEAL STRUCTURE FIELDS (collapsible)
   ========================================================================== */

.rex-deal-fields {
    display: none;
    margin-top: 15px;
    padding: 20px;
    background: var(--rex-bg-alt);
    border-radius: var(--rex-radius);
    border-left: 4px solid var(--rex-gold);
}

.rex-deal-fields.visible {
    display: block;
}

.rex-deal-fields-disabled {
    opacity: 0.7;
}

.rex-deal-fields-coming-soon {
    display: inline-block;
    padding: 4px 10px;
    background: var(--rex-warning-light);
    color: var(--rex-warning);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* ==========================================================================
   WELCOME SECTION (Dashboard)
   ========================================================================== */

.rex-welcome {
    background: var(--rex-card);
    border-radius: var(--rex-radius-xl);
    padding: 32px;
    margin-bottom: 25px;
    box-shadow: var(--rex-shadow-lg);
    border: 1px solid var(--rex-border);
    position: relative;
    overflow: hidden;
}

.rex-welcome::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--rex-primary), var(--rex-gold), var(--rex-accent));
}

.rex-welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.rex-welcome-left {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.rex-welcome-mascot {
    flex-shrink: 0;
}

.rex-welcome-text h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: var(--rex-font-display);
    color: var(--rex-primary-dark);
}

.rex-welcome-text p {
    color: var(--rex-muted);
    font-size: 16px;
}

.rex-your-rep {
    text-align: right;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--rex-bg-alt) 0%, var(--rex-bg) 100%);
    border-radius: var(--rex-radius-lg);
    border: 1px solid var(--rex-border);
}

.rex-rep-score {
    font-size: 42px;
    font-weight: 700;
    color: var(--rex-primary);
    font-family: var(--rex-font-display);
}

.rex-rep-label {
    font-size: 13px;
    color: var(--rex-muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   QUICK LINKS (Dashboard)
   ========================================================================== */

.rex-quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.rex-quick-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    background: var(--rex-card);
    border-radius: var(--rex-radius-lg);
    text-decoration: none;
    color: var(--rex-text);
    box-shadow: var(--rex-shadow);
    transition: all 0.25s;
    border: 2px solid transparent;
}

.rex-quick-link:hover {
    border-color: var(--rex-accent);
    transform: translateY(-3px);
    box-shadow: var(--rex-shadow-hover);
    text-decoration: none;
}

.rex-quick-link-icon {
    font-size: 28px;
}

.rex-quick-link-text {
    font-weight: 600;
    font-size: 15px;
    color: var(--rex-primary-dark);
}

.rex-quick-link-desc {
    font-size: 12px;
    color: var(--rex-muted);
    margin-top: 3px;
}

.rex-quick-link.primary {
    background: linear-gradient(135deg, var(--rex-accent) 0%, var(--rex-accent-light) 100%);
    color: white;
    border: none;
}

.rex-quick-link.primary .rex-quick-link-text {
    color: white;
}

.rex-quick-link.primary .rex-quick-link-desc {
    color: rgba(255,255,255,0.85);
}

.rex-quick-link.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(191,54,12,0.3);
}

/* ==========================================================================
   SECTION TITLES
   ========================================================================== */

.rex-section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--rex-font-display);
    color: var(--rex-primary-dark);
}

/* ==========================================================================
   ERROR PAGES
   ========================================================================== */

.rex-error-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.rex-error-card {
    background: var(--rex-card);
    border-radius: var(--rex-radius-xl);
    box-shadow: var(--rex-shadow-lg);
    padding: 50px;
    max-width: 550px;
    text-align: center;
    border-top: 4px solid var(--rex-gold);
}

.rex-error-mascot {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.rex-error-code {
    font-size: 13px;
    font-weight: 700;
    color: var(--rex-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.rex-error-title {
    font-family: var(--rex-font-display);
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--rex-text);
}

.rex-error-message {
    font-size: 17px;
    color: var(--rex-muted);
    line-height: 1.7;
    margin-bottom: 20px;
}

.rex-error-suggestion {
    font-size: 14px;
    color: var(--rex-text-light);
    margin-bottom: 30px;
    padding: 16px;
    background: var(--rex-bg-alt);
    border-radius: 10px;
    border-left: 4px solid var(--rex-gold);
}

.rex-error-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Debug info for error pages */
.rex-debug-info {
    margin-top: 25px;
    padding: 15px;
    background: #FFF3E0;
    border: 1px solid var(--rex-gold);
    border-radius: var(--rex-radius);
    font-size: 13px;
    color: var(--rex-text);
    text-align: left;
}

.rex-debug-trace {
    margin-top: 10px;
    padding: 15px;
    background: var(--rex-bg-alt);
    border: 1px solid var(--rex-border);
    border-radius: var(--rex-radius);
    font-size: 11px;
    overflow-x: auto;
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Monaco', 'Consolas', monospace;
}

/* ==========================================================================
   TOOLTIPS
   ========================================================================== */

.rex-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rex-tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--rex-info-light);
    color: var(--rex-info);
    font-size: 11px;
    cursor: help;
}

.rex-tooltip-content {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 14px;
    background: var(--rex-primary-dark);
    color: white;
    border-radius: var(--rex-radius);
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
}

.rex-tooltip:hover .rex-tooltip-content {
    display: block;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .rex-nav {
        display: none;
    }

    .rex-stats-bar {
        flex-direction: column;
        gap: 12px;
    }

    .rex-stat-divider {
        display: none;
    }

    .rex-page-title h1 {
        font-size: 24px;
    }

    .rex-welcome-header {
        flex-direction: column;
    }

    .rex-welcome-left {
        flex-direction: column;
        align-items: flex-start;
    }

    .rex-your-rep {
        text-align: left;
        width: 100%;
    }

    .rex-error-card {
        padding: 30px 25px;
    }

    .rex-error-title {
        font-size: 28px;
    }

    .rex-error-mascot svg {
        width: 100px !important;
        height: 100px !important;
    }
}
