/* HYDRA Guild Website - Design System (matches torreybot.com) */

:root {
    --apple-blue: #5794f2;
    --apple-blue-hover: #4e8ae6;
    --apple-green: #73bf69;
    --apple-red: #f2495c;
    --apple-orange: #ff9830;
    --apple-purple: #b877d9;
    --apple-yellow: #fade2a;

    --text-primary: #e6e6e6;
    --text-secondary: #a9a9a9;
    --text-tertiary: #8e8e8e;

    --background-primary: #1f1f23;
    --background-secondary: #2a2a2e;
    --background-tertiary: #323236;

    --border-light: #404040;
    --border-lighter: #383838;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

    /* WoW Class Colors */
    --class-warrior: #C79C6E;
    --class-paladin: #F58CBA;
    --class-hunter: #ABD473;
    --class-rogue: #FFF569;
    --class-priest: #FFFFFF;
    --class-shaman: #0070DE;
    --class-mage: #69CCF0;
    --class-warlock: #9482C9;
    --class-druid: #FF7D0A;

    /* Item Quality Colors */
    --quality-poor: #9d9d9d;
    --quality-common: #ffffff;
    --quality-uncommon: #1eff00;
    --quality-rare: #0070dd;
    --quality-epic: #a335ee;
    --quality-legendary: #ff8000;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 90px; /* Account for fixed nav + decoration */
}

/* Navigation */
.nav {
    background: var(--background-secondary);
    border-bottom: 1px solid var(--border-light);
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    overflow: visible;
    margin-bottom: 30px;
}

.nav-container {
    max-width: none;
    gap: 16px;
    padding-left: 20px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 60px;
    overflow: visible;
}

.nav-brand {
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
}

.nav-brand img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    flex-wrap: nowrap;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--background-tertiary);
}

.nav-link.active {
    color: var(--apple-blue);
    background: rgba(87, 148, 242, 0.1);
}

.nav-external {
    color: var(--apple-orange);
}

.nav-external:hover {
    color: var(--apple-orange);
    background: rgba(255, 152, 48, 0.1);
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-dropdown-toggle:hover {
    color: var(--text-primary);
    background: var(--background-tertiary);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--background-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: fit-content;
    margin-top: 8px;
    padding: 8px 0;
    z-index: 1000;
}

.nav-dropdown-menu.show {
    display: block !important;
}

.show-dropdown {
    display: block !important;
}

.nav-dropdown-toggle {
    cursor: pointer;
    user-select: none;
    color: var(--apple-orange) !important;
}

.nav-dropdown-toggle:hover {
    color: var(--apple-orange) !important;
    background: rgba(255, 152, 48, 0.1);
}

.nav-dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.nav-dropdown-item:hover {
    background: var(--background-tertiary);
    color: var(--text-primary);
}

/* External Resources dropdown items use orange */
.nav-dropdown-item-external {
    display: block;
    padding: 10px 16px;
    color: var(--apple-orange) !important;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.nav-dropdown-item-external:hover {
    background: var(--background-tertiary);
    color: var(--apple-orange) !important;
}

/* Mobile Nav */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-container {
        justify-content: space-between;
        padding: 0 16px;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--background-secondary);
        flex-direction: column;
        padding: 50px 16px 16px 16px;
        border-bottom: 1px solid var(--border-light);
        z-index: 999;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-link {
        width: 100%;
        text-align: center;
    }

    .nav-dropdown-menu {
        display: none;
        position: static;
        box-shadow: none;
        border: none;
        margin-top: 0;
        padding-left: 20px;
        background: var(--background-tertiary);
    }

    .nav-dropdown-menu.show {
        display: block !important;
    }

    .nav-dropdown-toggle {
        width: 100%;
        text-align: center;
    }
}

/* Main Container */
.container {
    
    margin: 0 auto;
    padding: 24px 20px;
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Cards */
.card {
    background: linear-gradient(135deg, rgba(42, 42, 46, 0.95) 0%, rgba(31, 31, 35, 0.95) 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-top-color: rgba(255, 215, 0, 0.4);
    border-bottom-color: rgba(139, 69, 19, 0.5);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 6px;
    background-image: url('/images/Maraudon_Redrawn_Loading_Screen.png');
    background-size: cover;
    background-position: center;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

.card > * {
    position: relative;
    z-index: 1;
}

/* Card background variants for different page themes */
.card-bg-scholomance::before {
    background-image: url('/images/naxx-real.jpg') !important;
    opacity: 0.15 !important;
}

.card-bg-naxxramas::before {
    background-image: url('/images/naxx-real.jpg') !important;
    opacity: 0.15 !important;
}

.card-bg-blackrock::before {
    background-image: url('/images/bwl-real.jpg') !important;
    opacity: 0.15 !important;
}

.card-bg-stratholme::before {
    background-image: url('/images/mc-real.jpg') !important;
    opacity: 0.15 !important;
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-blue { background: rgba(87, 148, 242, 0.2); color: var(--apple-blue); }
.badge-green { background: rgba(115, 191, 105, 0.2); color: var(--apple-green); }
.badge-orange { background: rgba(255, 152, 48, 0.2); color: var(--apple-orange); }
.badge-red { background: rgba(242, 73, 92, 0.2); color: var(--apple-red); }
.badge-purple { background: rgba(184, 119, 217, 0.2); color: var(--apple-purple); }
.badge-gray { background: rgba(142, 142, 147, 0.2); color: #8E8E93; }

/* Buttons - WoW Style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 13px;
    position: relative;
    overflow: hidden;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(87, 148, 242, 1) 0%, rgba(78, 138, 230, 0.9) 100%);
    color: white;
    border: 2px solid rgba(135, 178, 255, 0.5);
    border-top-color: rgba(178, 202, 255, 0.8);
    border-bottom-color: rgba(45, 98, 182, 0.8);
    box-shadow:
        0 2px 8px rgba(87, 148, 242, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(78, 138, 230, 1) 0%, rgba(87, 148, 242, 0.9) 100%);
    border-top-color: rgba(200, 220, 255, 0.9);
    box-shadow:
        0 4px 12px rgba(87, 148, 242, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    background: var(--apple-blue-hover);
}

.btn-secondary {
    background: var(--background-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-success {
    background: var(--apple-green);
    color: white;
}

.btn-danger {
    background: var(--apple-red);
    color: white;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-lighter);
}

th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    color: var(--text-primary);
}

tr:hover {
    background: var(--background-tertiary);
}

/* Raid Cards */
.raid-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--background-tertiary);
    border-radius: 8px;
    margin-bottom: 12px;
}

.raid-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--apple-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.raid-info {
    flex: 1;
}

.raid-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.raid-time {
    color: var(--text-secondary);
    font-size: 13px;
}

.raid-signups {
    display: flex;
    align-items: center;
    gap: 8px;
}

.signup-count {
    font-weight: 600;
    color: var(--apple-green);
}

/* Clickable Raid Cards */
.raid-card-link {
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.raid-card-link:hover {
    background: var(--border-light);
    transform: translateX(4px);
}

.raid-arrow {
    color: var(--text-tertiary);
    font-size: 20px;
    transition: transform 0.2s ease;
}

.raid-card-link:hover .raid-arrow {
    color: var(--apple-blue);
    transform: translateX(4px);
}

/* Loot Item */
.loot-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background-tertiary);
    border-radius: 8px;
    margin-bottom: 8px;
}

.loot-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 2px solid var(--quality-epic);
}

.loot-item-name {
    flex: 1;
}

.loot-item-name a {
    color: var(--quality-epic);
    text-decoration: none;
}

.loot-item-name a:hover {
    text-decoration: underline;
}

.loot-winner {
    font-weight: 500;
}

/* Class Colors */
.class-warrior { color: var(--class-warrior); }
.class-paladin { color: var(--class-paladin); }
.class-hunter { color: var(--class-hunter); }
.class-rogue { color: var(--class-rogue); }
.class-priest { color: var(--class-priest); }
.class-shaman { color: var(--class-shaman); }
.class-mage { color: var(--class-mage); }
.class-warlock { color: var(--class-warlock); }
.class-druid { color: var(--class-druid); }

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-light);
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-area:hover {
    border-color: var(--apple-blue);
    background: rgba(87, 148, 242, 0.05);
}

.upload-area.dragover {
    border-color: var(--apple-green);
    background: rgba(115, 191, 105, 0.1);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-text {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-hint {
    color: var(--text-tertiary);
    font-size: 13px;
}

/* Forms */
input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    background: var(--background-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--apple-blue);
}

/* Date picker icon fix for dark theme */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

input[type="date"]::-webkit-datetime-edit {
    color: var(--text-primary);
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

label {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 8px;
}

/* Grid */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Stats */
.stat-card {
    text-align: center;
    padding: 24px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--apple-blue);
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Footer */
.footer {
    background: var(--background-secondary);
    border-top: 1px solid var(--border-light);
    padding: 24px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
    margin-top: auto;
}

.footer a {
    color: var(--apple-blue);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--apple-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-success {
    background: rgba(115, 191, 105, 0.1);
    border: 1px solid var(--apple-green);
    color: var(--apple-green);
}

.alert-error {
    background: rgba(242, 73, 92, 0.1);
    border: 1px solid var(--apple-red);
    color: var(--apple-red);
}

.alert-info {
    background: rgba(87, 148, 242, 0.1);
    border: 1px solid var(--apple-blue);
    color: var(--apple-blue);
}

/* ========================================
   Raid Calendar Styles
   ======================================== */

.raid-calendar {
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

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

.calendar-month {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-nav-btn {
    background: var(--background-tertiary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: var(--apple-blue);
    color: white;
    border-color: var(--apple-blue);
}

.calendar-today-btn {
    background: var(--apple-blue);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.calendar-view-toggle {
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
    justify-content: center;
}

.view-btn {
    background: var(--background-tertiary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: var(--background-secondary);
}

.view-btn.active {
    background: var(--apple-blue);
    color: white;
    border-color: var(--apple-blue);
}

.calendar-day-headers {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
}

.calendar-day-header-cell {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    padding: 8px 0;
    box-sizing: border-box;
}

/* Ensure empty days don't collapse */
.calendar-day.no-raids {
    min-height: 100px;
}

.calendar-day-number-wrap {
    margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(42, 42, 46, 0.95) 0%, rgba(31, 31, 35, 0.95) 100%);
    padding: 8px;
    border-radius: 6px;
}

.other-month {
    opacity: 0.4;
}

.other-month .calendar-day-number {
    color: var(--text-tertiary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.calendar-grid.week-view {
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Week view styling - show day name prominently */
.calendar-grid.week-view .calendar-day-number-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-lighter);
}

.calendar-grid.week-view .calendar-day-number-wrap::before {
    content: attr(data-day-name);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-grid.week-view .calendar-day-number {
    font-size: 20px;
    font-weight: 700;
}

.calendar-grid.week-view .calendar-day {
    min-height: auto;
    padding: 16px;
    border-left: 3px solid var(--border-light);
}

.calendar-grid.week-view .calendar-today {
    border-left-color: var(--apple-blue);
    background: linear-gradient(90deg, rgba(0, 122, 255, 0.05) 0%, rgba(42, 42, 46, 0.92) 100%);
}

.calendar-grid.week-view .has-raids {
    border-left-color: var(--apple-green);
}

/* Hide empty days in week view */
.calendar-grid.week-view .calendar-day:not(:has(.calendar-raid)) {
    display: none;
}

.calendar-grid.month-view .calendar-day {
    min-height: 120px;
}

.calendar-day {
    background: linear-gradient(135deg, rgba(50, 50, 54, 0.92) 0%, rgba(42, 42, 46, 0.92) 100%);
    border-radius: 12px;
    min-height: 100px;
    padding: 12px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}

.calendar-day:hover {
    background: var(--background-secondary);
}

.calendar-today {
    border: 2px solid var(--apple-blue);
    box-shadow: 0 0 20px rgba(87, 148, 242, 0.3);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.15) 0%, rgba(42, 42, 46, 0.95) 100%) !important;
}

.calendar-past {
    filter: brightness(0.75);
}

.calendar-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.calendar-day-name {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.5px;
}

.calendar-day-number {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.today-number {
    background: var(--apple-blue);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.today-badge {
    background: var(--apple-blue);
    color: white;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 8px;
    animation: today-pulse 2s ease-in-out infinite;
}

@keyframes today-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.calendar-day-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-no-raids {
    color: var(--text-tertiary);
    font-size: 12px;
    text-align: center;
    padding: 20px 0;
}

.calendar-raid {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    border-left: 3px solid;
    text-decoration: none;
    transition: all 0.2s ease;
}

.calendar-raid:hover {
    transform: translateX(4px);
}

.calendar-raid-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.calendar-raid-info {
    flex: 1;
    min-width: 0;
}

.calendar-raid-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-raid-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.calendar-raid-signups {
    text-align: right;
    flex-shrink: 0;
}

.calendar-raid-signups .signup-number {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--apple-green);
}

.calendar-raid-signups .signup-label {
    font-size: 9px;
    color: var(--apple-green);
    text-transform: uppercase;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Next Raid Card */
.next-raid-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--apple-green);
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.1) 0%, transparent 50%);
}

.next-raid-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--apple-green);
    color: #000;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

.next-raid-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    text-decoration: none;
}

.next-raid-icon {
    font-size: 48px;
}

.next-raid-info {
    flex: 1;
}

.next-raid-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.next-raid-time {
    font-size: 16px;
    color: var(--apple-blue);
    margin-bottom: 4px;
}

.next-raid-leader {
    font-size: 13px;
    color: var(--text-tertiary);
}

.next-raid-signups {
    text-align: center;
    padding: 16px 24px;
    background: var(--background-tertiary);
    border-radius: 12px;
}

.signup-count-large {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: var(--apple-green);
}

.signup-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--apple-green);
}

/* Upcoming List */
.upcoming-list {
    display: flex;
    flex-direction: column;
}

.upcoming-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s ease;
}

.upcoming-item:last-child {
    border-bottom: none;
}

.upcoming-item:hover {
    background: var(--background-tertiary);
}

.upcoming-icon {
    font-size: 20px;
}

.upcoming-title {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.upcoming-date {
    color: var(--text-secondary);
    font-size: 13px;
}

.upcoming-signups {
    color: var(--apple-green);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(52, 199, 89, 0.1);
    border-radius: 4px;
}

/* Mobile Responsive Calendar */
@media (max-width: 900px) {
    /* Month view: Stack days vertically, hide days without raids */
    .calendar-grid.month-view {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .calendar-grid.month-view .calendar-day {
        min-height: auto;
        padding: 16px;
    }

    .calendar-grid.month-view .calendar-day:not(:has(.calendar-raid)) {
        display: none;
    }

    /* Week view already single column - no override needed */

    /* HIDE day headers on mobile - items are stacked vertically so Sun-Sat headers don't make sense */
    .calendar-day-headers {
        display: none;
    }

    /* Calendar header navigation improvements */
    .calendar-title {
        flex: 1;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .calendar-month {
        font-size: 16px;
        text-align: center;
        width: 100%;
    }

    .calendar-today-btn {
        font-size: 11px;
        padding: 4px 10px;
    }

    .calendar-nav-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .calendar-day-header {
        flex-direction: row;
    }

    .calendar-day-name {
        font-size: 13px;
    }

    .calendar-day-number {
        font-size: 18px;
    }

    .calendar-no-raids {
        display: none;
    }

    .next-raid-content {
        flex-direction: column;
        text-align: center;
    }

    .next-raid-signups {
        width: 100%;
    }

    .next-raid-badge {
        position: static;
        display: inline-block;
        margin-bottom: 12px;
    }
}

/* Hide scrollbar on nav-links */
.nav-links::-webkit-scrollbar {
    display: none;
}

/* Shared Login Banner Component Styles */
.login-banner {
  background: linear-gradient(135deg, #2d4a6d, #1a3a5c);
  border: 2px solid #5dade2;
  border-radius: 12px;
  padding: 20px 30px;
  margin: 15px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}
.login-banner-text { color: #b0c4de; }
.login-banner-title { color: #5dade2; font-weight: bold; margin-bottom: 5px; }
.login-banner-subtitle { font-size: 0.9rem; }
.discord-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #5865F2;
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s;
}
.discord-login-btn:hover { background: #4752c4; }
.user-welcome { color: #4ade80; font-size: 0.85rem; margin: 10px 0; }

/* ====================================
   CONSUMES ANALYTICS PAGE STYLES
   ==================================== */

.analytics-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.analytics-page .page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 1rem;
}

.analytics-page .page-header-content {
  text-align: left;
}

.analytics-page .page-header h1 {
  color: #5dade2;
  font-size: 2rem;
  margin-bottom: 8px;
}

.analytics-page .page-subtitle {
  color: #b0c4de;
  font-size: 1rem;
}

.analytics-page .page-header-actions {
  display: flex;
  gap: 0.75rem;
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(93, 173, 226, 0.2);
  border: 1px solid rgba(93, 173, 226, 0.4);
  border-radius: 6px;
  color: #5dade2;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.header-action-btn:hover {
  background: rgba(93, 173, 226, 0.3);
  border-color: rgba(93, 173, 226, 0.6);
}

.analytics-dashboard {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.analytics-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 15px;
  background: rgba(30, 40, 60, 0.6);
  border-radius: 8px;
  flex-wrap: wrap;
}

.analytics-controls label {
  color: #b0c4de;
  display: flex;
  align-items: center;
  gap: 10px;
}

.analytics-controls select {
  background: #1a2a3a;
  color: #e0e8f0;
  border: 1px solid #3a4a5a;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.refresh-btn {
  background: #2d4a6d;
  color: #5dade2;
  border: 1px solid #5dade2;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-btn:hover {
  background: #5dade2;
  color: #1a2a3a;
}

.analytics-section {
  background: rgba(30, 40, 60, 0.5);
  border: 1px solid #3a4a5a;
  border-radius: 12px;
  padding: 20px;
}

.analytics-section h2 {
  color: #5dade2;
  font-size: 1.3rem;
  margin-bottom: 15px;
  border-bottom: 1px solid #3a4a5a;
  padding-bottom: 10px;
}

.section-subtitle {
  color: #8899aa;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

/* Stats Cards */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.stats-cards.secondary {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.stat-card {
  background: rgba(20, 30, 50, 0.7);
  border: 1px solid #3a4a5a;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.stat-card.small {
  padding: 12px;
}

.stat-card.highlight {
  border-color: #5dade2;
  background: rgba(93, 173, 226, 0.1);
}

.stat-card.gold {
  border-color: #f1c40f;
  background: rgba(241, 196, 15, 0.1);
}

.stat-card.pending {
  border-color: #f39c12;
}

.stat-card.processing {
  border-color: #3498db;
}

.stat-card.completed {
  border-color: #2ecc71;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: bold;
  color: #e0e8f0;
}

.stat-card.small .stat-value {
  font-size: 1.3rem;
}

.stat-label {
  color: #8899aa;
  font-size: 0.85rem;
  margin-top: 5px;
}

/* Herbs Grid */
.herbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.herb-card {
  background: rgba(46, 125, 50, 0.15);
  border: 1px solid #4caf50;
  border-radius: 8px;
  padding: 12px;
}

.herb-quantity {
  font-size: 1.5rem;
  font-weight: bold;
  color: #81c784;
}

.herb-name {
  color: #c8e6c9;
  font-weight: 500;
  margin: 5px 0;
}

.herb-sources {
  font-size: 0.75rem;
  color: #8899aa;
}

.herb-source {
  display: block;
  margin-top: 3px;
}

/* Analytics Table */
.analytics-table {
  width: 100%;
  border-collapse: collapse;
}

.analytics-table th,
.analytics-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #3a4a5a;
}

.analytics-table th {
  color: #5dade2;
  font-weight: 600;
  background: rgba(20, 30, 50, 0.5);
}

.analytics-table td {
  color: #c8d0e0;
}

.analytics-table tr:hover {
  background: rgba(93, 173, 226, 0.05);
}

.rank {
  color: #f1c40f;
  font-weight: bold;
  margin-right: 8px;
}

.gold-text {
  color: #f1c40f;
}

/* Fill Rate Card */
.stat-card.fill-rate {
  border-color: #2ecc71;
  background: rgba(46, 204, 113, 0.1);
}

.stat-bar {
  width: 100%;
  height: 6px;
  background: #2a3a4a;
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  background: linear-gradient(to right, #2ecc71, #58d68d);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Demand Bars - Most Demanded Consumables */
.demand-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.demand-bar-row {
  display: grid;
  grid-template-columns: 40px 180px 1fr 100px;
  gap: 12px;
  align-items: center;
}

.demand-bar-rank {
  color: #f1c40f;
  font-weight: bold;
  text-align: center;
}

.demand-bar-name {
  color: #e0e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demand-bar-container {
  height: 28px;
  background: #1a2a3a;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.demand-bar-fill {
  height: 100%;
  background: linear-gradient(to right, #e67e22, #f39c12);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.demand-bar-value {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-weight: bold;
  font-size: 0.9rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.demand-bar-revenue {
  text-align: right;
  font-weight: 500;
}

/* Herb Demand Analysis */
.herb-demand-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.herb-demand-row {
  background: rgba(20, 30, 50, 0.5);
  border-radius: 8px;
  padding: 12px;
  border-left: 4px solid #4caf50;
}

.herb-demand-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.herb-demand-name {
  color: #c8e6c9;
  font-weight: 600;
  font-size: 1rem;
}

.herb-demand-level {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
}

.herb-demand-level.high {
  background: rgba(231, 76, 60, 0.25);
  color: #e74c3c;
  border: 1px solid #e74c3c;
}

.herb-demand-level.med {
  background: rgba(241, 196, 15, 0.25);
  color: #f1c40f;
  border: 1px solid #f1c40f;
}

.herb-demand-level.low {
  background: rgba(46, 204, 113, 0.25);
  color: #2ecc71;
  border: 1px solid #2ecc71;
}

.herb-demand-bar-container {
  height: 24px;
  background: #1a2a3a;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
}

.herb-demand-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.herb-demand-bar-fill.high {
  background: linear-gradient(to right, #c0392b, #e74c3c);
}

.herb-demand-bar-fill.med {
  background: linear-gradient(to right, #d4ac0d, #f1c40f);
}

.herb-demand-bar-fill.low {
  background: linear-gradient(to right, #27ae60, #2ecc71);
}

.herb-demand-qty {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-weight: bold;
  font-size: 0.85rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.herb-demand-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.herb-demand-source {
  font-size: 0.75rem;
  color: #8899aa;
  background: rgba(30, 40, 60, 0.5);
  padding: 3px 8px;
  border-radius: 4px;
}

.herb-demand-more {
  font-size: 0.75rem;
  color: #5dade2;
  font-style: italic;
}

/* Reagent Demand Analysis */
.reagent-type-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.reagent-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.reagent-type-badge.herb {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.reagent-type-badge.vendor {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.reagent-type-badge.drop {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.reagent-type-badge.crafted {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.reagent-type-badge.other {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.reagent-type-badge.has-tooltip {
  position: relative;
  cursor: help;
}

.badge-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a24;
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  width: 240px;
  text-align: center;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.badge-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.15);
}

.reagent-type-badge.has-tooltip:hover .badge-tooltip {
  display: block;
}

.reagent-demand-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reagent-demand-row {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.reagent-demand-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.reagent-type-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.reagent-item-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.reagent-demand-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e0e0e0;
  text-decoration: none;
}

.reagent-demand-name:hover {
  color: #5dade2;
  text-decoration: underline;
}

.reagent-demand-level {
  font-size: 0.7rem;
  font-weight: bold;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.reagent-demand-level.high {
  background: rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.reagent-demand-level.med {
  background: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.reagent-demand-level.low {
  background: rgba(34, 197, 94, 0.3);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.5);
}

.reagent-demand-bar-container {
  position: relative;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.reagent-demand-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.reagent-demand-bar-fill.high {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.reagent-demand-bar-fill.med {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.reagent-demand-bar-fill.low {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.reagent-demand-qty {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  font-weight: bold;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.reagent-demand-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.75rem;
}

.reagent-demand-source {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: #b0b0b0;
}

.reagent-demand-more {
  font-size: 0.75rem;
  color: #5dade2;
  font-style: italic;
}

.herbalist-cta {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 6px;
  color: #9ca3af;
}

.herbalist-cta a {
  color: #22c55e;
}

.herbalist-cta a:hover {
  text-decoration: underline;
}

/* Responsive Demand Bars */
@media (max-width: 768px) {
  .demand-bar-row {
    grid-template-columns: 30px 1fr 80px;
  }

  .demand-bar-name {
    grid-column: 2 / 3;
    grid-row: 1;
  }

  .demand-bar-container {
    grid-column: 1 / 4;
    grid-row: 2;
  }

  .demand-bar-revenue {
    display: none;
  }
}

/* Trends */
.trends-summary {
  display: flex;
  gap: 30px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.trend-stat {
  color: #b0c4de;
}

.trend-label {
  color: #8899aa;
  margin-right: 8px;
}

.trend-value {
  color: #e0e8f0;
  font-weight: 500;
}

/* Bar Chart */
.trends-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 150px;
  padding: 10px 0;
}

.chart-bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end; /* Bars start at bottom and grow up */
  height: 100%;
}

.chart-bar {
  width: 100%;
  max-width: 40px;
  background: linear-gradient(to top, #3498db, #5dade2);
  border-radius: 4px 4px 0 0;
  position: relative;
  min-height: 2px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.bar-value {
  color: #fff;
  font-size: 0.7rem;
  font-weight: bold;
  padding-top: 4px;
}

.bar-label {
  color: #8899aa;
  font-size: 0.7rem;
  margin-top: 5px;
}

/* Customers */
.customers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.customer-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  background: rgba(20, 30, 50, 0.5);
  border-radius: 6px;
}

.customer-rank {
  color: #f1c40f;
  font-weight: bold;
  width: 30px;
}

.customer-name {
  color: #e0e8f0;
  flex: 1;
}

.customer-spent {
  font-weight: bold;
}

/* Footer */
.analytics-footer {
  text-align: center;
  color: #6a7a8a;
  font-size: 0.8rem;
  padding-top: 10px;
  border-top: 1px solid #3a4a5a;
}

/* Loading & Error States */
.analytics-loading,
.analytics-error {
  text-align: center;
  padding: 60px 20px;
  color: #b0c4de;
}

.analytics-loading .loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #3a4a5a;
  border-top-color: #5dade2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

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

.analytics-error button {
  margin-top: 15px;
  padding: 10px 20px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.no-data {
  color: #6a7a8a;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .analytics-page {
    padding: 10px;
  }

  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .herbs-grid {
    grid-template-columns: 1fr 1fr;
  }

  .analytics-table {
    font-size: 0.85rem;
  }

  .analytics-table th,
  .analytics-table td {
    padding: 8px;
  }

  .trends-chart {
    height: 100px;
  }
}

/* ====================================
   CONSUMES QUEUE PAGE STYLES
   ==================================== */

.queue-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.queue-page .page-header {
  text-align: center;
  margin-bottom: 20px;
}

.queue-page .page-header h1 {
  color: #5dade2;
  font-size: 2rem;
  margin-bottom: 8px;
}

.queue-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Crafter Input */
.crafter-input {
  background: rgba(30, 40, 60, 0.6);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #3a4a5a;
}

.crafter-input label {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #b0c4de;
}

.crafter-input input {
  flex: 1;
  max-width: 300px;
  background: #1a2a3a;
  color: #e0e8f0;
  border: 1px solid #3a4a5a;
  padding: 10px 15px;
  border-radius: 4px;
  font-size: 1rem;
}

.crafter-input input:focus {
  outline: none;
  border-color: #5dade2;
}

/* Queue Tabs */
.queue-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  background: rgba(20, 30, 50, 0.5);
  padding: 10px;
  border-radius: 8px;
}

.queue-tab {
  background: rgba(30, 40, 60, 0.8);
  color: #b0c4de;
  border: 1px solid #3a4a5a;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.queue-tab:hover {
  background: rgba(93, 173, 226, 0.2);
  border-color: #5dade2;
}

.queue-tab.active {
  background: #5dade2;
  color: #1a2a3a;
  border-color: #5dade2;
  font-weight: bold;
}

/* Queue Controls */
.queue-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.queue-count {
  color: #8899aa;
  font-size: 0.9rem;
}

/* Orders List */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-card {
  background: rgba(30, 40, 60, 0.6);
  border: 1px solid #3a4a5a;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s;
}

.order-card:hover {
  border-color: #5a6a7a;
}

.order-card.expanded {
  border-color: #5dade2;
}

/* Status-based left border */
.order-card.status-pending {
  border-left: 4px solid #f39c12;
}

.order-card.status-claimed {
  border-left: 4px solid #3498db;
}

.order-card.status-fulfilled {
  border-left: 4px solid #9b59b6;
}

.order-card.status-completed {
  border-left: 4px solid #2ecc71;
}

.order-card.status-cancelled {
  border-left: 4px solid #e74c3c;
  opacity: 0.7;
}

/* Order Header */
.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  cursor: pointer;
  flex-wrap: wrap;
  gap: 10px;
}

.order-main {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.order-status {
  font-weight: bold;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  color: #e0e8f0;
}

.order-customer {
  color: #5dade2;
  font-weight: 500;
}

.order-summary {
  color: #b0c4de;
  font-size: 0.9rem;
}

.order-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #8899aa;
  font-size: 0.85rem;
}

.order-total {
  color: #f1c40f;
  font-weight: bold;
}

.expand-icon {
  color: #5dade2;
  font-size: 0.8rem;
}

/* Order Details */
.order-details {
  padding: 15px;
  border-top: 1px solid #3a4a5a;
  background: rgba(20, 30, 50, 0.5);
}

.order-items {
  margin-bottom: 15px;
}

.order-items h4 {
  color: #5dade2;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.order-items ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.order-items li {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #2a3a4a;
  color: #c8d0e0;
}

.item-qty {
  color: #5dade2;
  font-weight: bold;
  min-width: 40px;
}

.item-name {
  flex: 1;
}

.item-price {
  color: #f1c40f;
  font-size: 0.85rem;
}

.order-notes {
  background: rgba(241, 196, 15, 0.1);
  border: 1px solid rgba(241, 196, 15, 0.3);
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  color: #f1c40f;
  font-size: 0.9rem;
}

.order-workflow {
  margin-bottom: 15px;
  font-size: 0.85rem;
  color: #b0c4de;
}

.order-workflow p {
  margin: 5px 0;
}

/* Action Buttons */
.order-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.action-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-btn.claim {
  background: #3498db;
  color: white;
}

.action-btn.claim:hover:not(:disabled) {
  background: #2980b9;
}

.action-btn.fulfill {
  background: #9b59b6;
  color: white;
}

.action-btn.fulfill:hover:not(:disabled) {
  background: #8e44ad;
}

.action-btn.complete {
  background: #2ecc71;
  color: white;
}

.action-btn.complete:hover:not(:disabled) {
  background: #27ae60;
}

.action-btn.unclaim {
  background: transparent;
  color: #b0c4de;
  border: 1px solid #5a6a7a;
}

.action-btn.unclaim:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.action-btn.cancel {
  background: transparent;
  color: #e74c3c;
  border: 1px solid #e74c3c;
}

.action-btn.cancel:hover:not(:disabled) {
  background: rgba(231, 76, 60, 0.2);
}

.order-id {
  font-size: 0.75rem;
  color: #6a7a8a;
  font-family: monospace;
}

/* Loading & Error */
.queue-loading,
.queue-error {
  text-align: center;
  padding: 60px 20px;
  color: #b0c4de;
}

.queue-loading .loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #3a4a5a;
  border-top-color: #5dade2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

.queue-error button {
  margin-top: 15px;
  padding: 10px 20px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.no-orders {
  text-align: center;
  padding: 40px;
  color: #6a7a8a;
  background: rgba(30, 40, 60, 0.3);
  border-radius: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .queue-page {
    padding: 10px;
  }

  .queue-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .queue-tab {
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  .order-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .order-meta {
    width: 100%;
    justify-content: space-between;
  }

  .order-actions {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
    text-align: center;
  }

  .crafter-input label {
    flex-direction: column;
    align-items: flex-start;
  }

  .crafter-input input {
    max-width: 100%;
    width: 100%;
  }
}

/* ============================================
   P&L Section Styles
   ============================================ */

.pnl-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.pnl-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 16px;
  text-align: center;
}

.pnl-card.revenue { border-left: 3px solid #f5a623; }
.pnl-card.costs { border-left: 3px solid #f87171; }
.pnl-card.profit.positive { border-left: 3px solid #22c55e; }
.pnl-card.profit.negative { border-left: 3px solid #ef4444; }

.pnl-card-icon { font-size: 1.1rem; display: inline; margin-right: 6px; vertical-align: middle; }

.pnl-card-value {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  display: inline;
  vertical-align: middle;
}

.pnl-card-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.pnl-card-detail {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 4px;
}

.herb-cost-text { color: #f87171; }
.profit-text { color: #22c55e; }
.loss-text { color: #ef4444; }

/* P&L Cumulative Area Chart */
.pnl-chart {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 24px;
}

.pnl-chart-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pnl-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.pnl-chart-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.pnl-chart-svg {
  width: 100%;
  height: 220px;
}

.pnl-chart-svg svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* P&L Side-by-side Breakdowns */
.pnl-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.pnl-breakdown-col {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 16px;
}

.pnl-breakdown-col h3 {
  font-size: 0.9rem;
  margin: 0 0 12px 0;
  color: rgba(255, 255, 255, 0.8);
}

.pnl-status-list { margin-bottom: 12px; }

.pnl-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
}

.pnl-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pnl-status-dot.pending { background: #f59e0b; }
.pnl-status-dot.processing { background: #3b82f6; }
.pnl-status-dot.completed { background: #22c55e; }
.pnl-status-dot.cancelled { background: #6b7280; }

.pnl-status-count {
  margin-left: auto;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.pnl-stat-extra {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  padding: 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pnl-stat-extra:first-of-type { margin-top: 4px; }

.pnl-stat-extra strong { color: rgba(255, 255, 255, 0.9); }

.pnl-stat-extra.pending-warning {
  color: #f59e0b;
}

/* P&L Leaderboards */
.pnl-leaderboard { display: flex; flex-direction: column; gap: 6px; }

.pnl-leader-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 0.82rem;
}

.pnl-leader-rank {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
  width: 24px;
  flex-shrink: 0;
}

.pnl-leader-name {
  flex: 1;
  color: rgba(255, 255, 255, 0.85);
}

.pnl-leader-value {
  font-weight: 600;
  flex-shrink: 0;
}

.see-more-btn {
  background: none;
  border: none;
  color: var(--apple-blue, #007AFF);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 6px 0 2px;
  text-align: left;
  opacity: 0.85;
}
.see-more-btn:hover { opacity: 1; text-decoration: underline; }

/* P&L Responsive */
@media (max-width: 768px) {
  .pnl-cards {
    grid-template-columns: 1fr;
  }

  .pnl-breakdown {
    grid-template-columns: 1fr;
  }

  .pnl-chart-svg { height: 180px; }
  .pnl-chart-legend { gap: 10px; }
}

/* ================================
   CONSUMES QUEUE PAGE STYLES
   Extracted from islands/ConsumesQueue.tsx
   ================================ */

.queue-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ================================
   HEADER SECTION
   ================================ */
.header-section {
  background: linear-gradient(135deg, rgba(30, 30, 40, 0.98), rgba(20, 20, 30, 0.98));
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d4af37;
  font-size: 14px;
}

.user-info .username {
  font-weight: bold;
}

.login-prompt {
  color: #ff6b6b;
  font-size: 14px;
}

.login-prompt a {
  color: #d4af37;
  text-decoration: underline;
}

.view-toggle {
  display: flex;
  gap: 8px;
}

.queue-container .view-btn {
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  color: #c0c0c0;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.queue-container .view-btn:hover {
  background: rgba(255,255,255,0.05);
  color: #ccc;
}

.queue-container .view-btn.active {
  background: rgba(212, 175, 55, 0.2);
  border-color: rgba(212, 175, 55, 0.5);
  color: #d4af37;
}

/* ================================
   TABS
   ================================ */
.tabs-wrapper {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  border-bottom: 1px solid #3a3a3a;
  padding-bottom: 0;
  position: sticky;
  top: 60px;
  z-index: 100;
  background: linear-gradient(180deg, #1a1a1a 0%, #1a1a1a 90%, transparent 100%);
  padding-top: 8px;
}

.tab-btn {
  padding: 12px 24px;
  border: 1px solid #3a3a3a;
  border-bottom: 3px solid transparent;
  background: #2a2a2a;
  color: #c0c0c0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: -1px;
  border-radius: 8px 8px 0 0;
}

.tab-btn:hover {
  color: #ccc;
  background: #333;
}

.tab-btn.active {
  color: #d4af37;
  border-bottom-color: #d4af37;
  background: #333;
}

.tab-btn.orders-tab.active {
  color: #5dade2;
  border-bottom-color: #3498db;
  background: #2a3a4a;
}

.tab-btn.herbs-tab.active {
  color: #58d68d;
  border-bottom-color: #2ecc71;
  background: #2a3a2a;
}

.tab-count {
  display: inline-block;
  background: #1a1a1a;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  margin-left: 6px;
}

/* ================================
   FILTER TABS
   ================================ */
.filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 110px;
  z-index: 99;
  background: #1a1a1a;
  padding: 12px 0;
  margin-top: 0;
}

.filter-tabs {
  display: flex;
  gap: 4px;
}

.filter-tab {
  padding: 8px 14px;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  background: #252525;
  color: #b0b0b0;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.filter-tab:hover {
  background: #333;
  color: #bbb;
  border-color: #4a4a4a;
}

.filter-tab.active {
  background: #3a3a3a;
  color: #fff;
  border-color: #555;
}

/* Money Flow */
.money-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 20px;
}

.money-flow.customer-pays {
  background: rgba(52, 152, 219, 0.15);
  color: #5dade2;
}

.money-flow.guild-pays {
  background: rgba(46, 204, 113, 0.15);
  color: #58d68d;
}

/* ================================
   RESTOCK NEEDED PANEL
   ================================ */
.restock-panel {
  margin: 0 0 12px 0;
  border: 1px solid rgba(240, 160, 48, 0.4);
  border-radius: 8px;
  background: rgba(240, 160, 48, 0.06);
  overflow: visible;
}

.restock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  background: rgba(240, 160, 48, 0.12);
  user-select: none;
  border-radius: 7px 7px 0 0;
}

.restock-header:hover {
  background: rgba(240, 160, 48, 0.18);
}

.restock-title {
  font-weight: 600;
  font-size: 13px;
  color: #f0a030;
  letter-spacing: 0.3px;
}

.restock-chevron {
  font-size: 11px;
  color: #f0a030;
  transition: transform 0.2s ease;
  transform: rotate(-90deg);
}

.restock-chevron.expanded {
  transform: rotate(0deg);
}

.restock-grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(240, 160, 48, 0.1);
}

.restock-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(20, 20, 30, 0.7);
}

.restock-item-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.restock-item-info {
  flex: 1;
  min-width: 0;
}

.restock-item-name {
  font-size: 13px;
  font-weight: 500;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.restock-item-name a {
  color: #f0a030;
  text-decoration: none;
}

.restock-item-name a:hover {
  color: #ffc04d;
  text-decoration: underline;
}

.restock-item-details {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.restock-short {
  color: #e74c3c;
  font-weight: 600;
}

.restock-in-bank {
  color: #6b7280;
  font-size: 0.85em;
}

.restock-orders {
  color: #b0b0b0;
}

.restock-date {
  color: #888;
}

.restock-btn {
  flex-shrink: 0;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(46, 204, 113, 0.4);
  border-radius: 4px;
  background: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.restock-btn:hover:not(:disabled) {
  background: rgba(46, 204, 113, 0.25);
  border-color: rgba(46, 204, 113, 0.6);
}

.restock-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.restock-recipe {
  font-size: 11px;
  color: #888;
  font-weight: 400;
}

.restock-admin-badge {
  display: inline-block;
  font-size: 11px;
  color: #9b59b6;
  font-weight: 500;
}

.admin-restock-form {
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(240, 160, 48, 0.15);
}

.admin-restock-search {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  color: #e0e0e0;
  outline: none;
  box-sizing: border-box;
}

.admin-restock-search:focus {
  border-color: rgba(240, 160, 48, 0.5);
}

.admin-restock-search::placeholder {
  color: #666;
}

.admin-restock-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  margin-top: 2px;
}

.admin-restock-result-item {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  font-size: 12px;
  color: #e0e0e0;
  cursor: pointer;
}

.admin-restock-result-item:hover {
  background: rgba(240, 160, 48, 0.15);
}

.admin-restock-remove {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 4px;
  color: #e74c3c;
  font-size: 12px;
  cursor: pointer;
  margin-right: 6px;
  padding: 0;
}

.admin-restock-remove:hover:not(:disabled) {
  background: rgba(231, 76, 60, 0.15);
  border-color: rgba(231, 76, 60, 0.5);
}

.admin-restock-remove:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ================================
   TABLE
   ================================ */
.table-wrapper {
  overflow-x: auto;
}

.queue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
}

.queue-table th {
  text-align: left;
  padding: 12px 10px;
  background: #1a1a1a;
  color: #c0c0c0;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #3a3a3a;
}

.queue-table td {
  padding: 14px 10px;
  border-bottom: 1px solid #333;
  vertical-align: top;
  background: inherit;
}

.queue-table tbody tr {
  transition: background 0.15s;
  cursor: pointer;
  background: #2a2a2a;
}

.queue-table tbody tr:nth-child(odd) {
  background: #252525;
}

.queue-table tbody tr:nth-child(even) {
  background: #2f2f2f;
}

.queue-table tbody tr:hover {
  background: #383838;
}

.queue-table tbody tr.expanded {
  background: #3a3525;
}

.queue-table tbody tr.expanded-details {
  background: #2a2820;
}

/* Columns */
.col-id {
  width: 100px;
}

.queue-container .order-id {
  font-family: monospace;
  font-size: 12px;
  color: #b0b0b0;
  background: rgba(0,0,0,0.3);
  padding: 4px 8px;
  border-radius: 4px;
}

.col-requester {
  width: 140px;
}

.requester-name {
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 4px;
}

.requester-date {
  font-size: 11px;
  color: #b0b0b0;
  line-height: 1.4;
}

.col-items {
  min-width: 200px;
}

.item-line {
  font-size: 13px;
  color: #bbb;
  margin-bottom: 4px;
  line-height: 1.4;
}

.queue-container .item-qty {
  color: #d4af37;
  font-weight: 600;
  margin-right: 4px;
}

.item-total {
  font-size: 12px;
  color: #d4af37;
  margin-top: 8px;
  font-weight: 600;
}

.order-reagents {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #333;
}

.reagent-line {
  font-size: 11px;
  color: #888;
  line-height: 1.5;
}

.reagent-line .reagent-qty {
  color: #d4af37;
  font-weight: 600;
}

.reagent-line-herb { color: #58d68d; }
.reagent-line-vendor { color: #b0b0b0; }
.reagent-line-drop { color: #e74c3c; }
.reagent-line-crafted { color: #f39c12; }
.reagent-line-other { color: #888; }

.modal-reagents {
  padding: 10px 16px;
  border-top: 1px solid #333;
  border-bottom: 1px solid #333;
  background: rgba(0,0,0,0.15);
}

.modal-reagents-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.col-status {
  width: 110px;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-pending { background: rgba(241, 196, 15, 0.2); color: #f1c40f; }
.status-claimed { background: rgba(52, 152, 219, 0.2); color: #3498db; }
.status-fulfilled { background: rgba(155, 89, 182, 0.2); color: #9b59b6; }
.status-completed { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.status-received { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.status-issue { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }

.claimed-by {
  font-size: 11px;
  color: #b0b0b0;
  margin-top: 4px;
}

.claimed-by strong {
  color: #5dade2;
}

.col-actions {
  width: 280px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.queue-container .action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.queue-container .action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-claim {
  background: #1e3a4d;
  color: #5dade2;
  border: 1px solid #2a5070;
}

.btn-claim:hover:not(:disabled) {
  background: #264a60;
}

.btn-claimed {
  background: #333;
  color: #c0c0c0;
  border: 1px solid #444;
  font-size: 11px;
}

.btn-fulfill {
  background: #1e4030;
  color: #58d68d;
  border: 1px solid #2a6040;
}

.btn-fulfill:hover:not(:disabled) {
  background: #285540;
}

.btn-fulfilled {
  background: #333;
  color: #c0c0c0;
  border: 1px solid #444;
  font-size: 11px;
}

.btn-receive {
  background: #1e4030;
  color: #58d68d;
  border: 1px solid #2a6040;
}

.btn-receive:hover:not(:disabled) {
  background: #285540;
}

/* ================================
   EXPANDED DETAILS
   ================================ */
.expanded-details td {
  padding: 0 !important;
  background: #222 !important;
}

.detail-content {
  padding: 20px;
  background: #1e1e1e;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.detail-item {
  background: #2a2a2a;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #333;
}

.detail-label {
  font-size: 11px;
  color: #b0b0b0;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.detail-value {
  font-size: 14px;
  color: #ccc;
}

.detail-value.highlight { color: #3498db; }
.detail-value.purple { color: #9b59b6; }
.detail-value.gold { color: #d4af37; font-weight: 600; }
.detail-value.success { color: #2ecc71; }

.notes-box {
  background: rgba(0,0,0,0.2);
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #c0c0c0;
  margin-bottom: 16px;
}

.expanded-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ================================
   HERBALIST FLOW
   ================================ */
.herbalist-flow {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.herbalist-name {
  font-weight: 600;
  color: #2ecc71;
}

.flow-arrow {
  color: #b0b0b0;
  font-size: 11px;
}

.alchemist-name {
  color: #9b59b6;
  font-weight: 500;
}

.mailed-from {
  font-size: 10px;
  color: #b0b0b0;
}

/* ================================
   MODAL
   ================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: linear-gradient(135deg, #1e1e28, #14141e);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

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

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #d4af37;
}

.modal-close {
  background: none;
  border: none;
  color: #b0b0b0;
  font-size: 24px;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

.modal-customer {
  color: #b0b0b0;
  font-size: 14px;
  margin-bottom: 20px;
}

.fulfill-options {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.fulfill-option {
  flex: 1;
  padding: 16px;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(0,0,0,0.3);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.fulfill-option:hover {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(212, 175, 55, 0.1);
}

.fulfill-option-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.fulfill-option-label {
  font-size: 14px;
  font-weight: 600;
  color: #ccc;
}

.fulfill-option-desc {
  font-size: 11px;
  color: #b0b0b0;
  margin-top: 4px;
}

.partial-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.partial-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.3);
  padding: 12px;
  border-radius: 6px;
}

.partial-item-name {
  color: #ccc;
  font-size: 14px;
}

.partial-item-ordered {
  font-size: 12px;
  color: #b0b0b0;
}

.partial-item-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.partial-item-input input {
  width: 60px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-btn-cancel {
  background: rgba(100,100,100,0.3);
  color: #b0b0b0;
}

.modal-btn-cancel:hover {
  background: rgba(100,100,100,0.5);
  color: #ccc;
}

.modal-btn-submit {
  background: rgba(46, 204, 113, 0.3);
  color: #2ecc71;
}

.modal-btn-submit:hover {
  background: rgba(46, 204, 113, 0.5);
}

/* ================================
   EMPTY & LOADING STATES
   ================================ */
.loading-text {
  text-align: center;
  padding: 40px;
  color: #b0b0b0;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #b0b0b0;
}

.empty-state .emoji {
  font-size: 48px;
  margin-bottom: 16px;
}

/* ================================
   ADMIN MODE
   ================================ */
.admin-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-btn {
  padding: 6px 14px;
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 6px;
  background: rgba(231, 76, 60, 0.1);
  color: #b0b0b0;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.admin-btn:hover {
  background: rgba(231, 76, 60, 0.2);
  color: #c0c0c0;
}

.admin-btn.active {
  background: rgba(231, 76, 60, 0.3);
  border-color: rgba(231, 76, 60, 0.6);
  color: #e74c3c;
}

.filter-tab.hidden-tab {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.filter-tab.hidden-tab.active {
  background: rgba(231, 76, 60, 0.25);
  color: #ff6b6b;
}

.btn-hide {
  background: #3d2020;
  color: #e74c3c;
  border: 1px solid #5a2828;
  padding: 4px 8px;
  font-size: 11px;
}

.btn-hide:hover:not(:disabled) {
  background: #4d2828;
}

.btn-restore {
  background: #1e4030;
  color: #58d68d;
  border: 1px solid #2a6040;
}

.btn-restore:hover:not(:disabled) {
  background: #285540;
}

.btn-delete {
  background: #4a1515;
  color: #ff4444;
  border: 1px solid #6a2020;
  padding: 4px 8px;
  font-size: 11px;
}

.btn-delete:hover:not(:disabled) {
  background: #5a2020;
}

.btn-delete-all {
  background: #4a1515;
  color: #ff4444;
  border: 1px solid #6a2020;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 8px;
}

.btn-delete-all:hover:not(:disabled) {
  background: #5a2020;
  border-color: #8a3030;
}

.confirm-btn-delete {
  background: #6a1515;
  color: #ff4444;
}

.confirm-btn-delete:hover {
  background: #7a2020;
}

.hidden-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  margin-left: 6px;
}

/* Confirmation Modal */
.confirm-modal-content {
  background: linear-gradient(135deg, #1e1e28, #14141e);
  border: 1px solid rgba(231, 76, 60, 0.5);
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.confirm-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.confirm-title {
  font-size: 18px;
  font-weight: 600;
  color: #e74c3c;
  margin-bottom: 12px;
}

.confirm-message {
  color: #c0c0c0;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.confirm-sale-info {
  background: rgba(0,0,0,0.3);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  text-align: left;
}

.confirm-sale-info .info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 13px;
}

.confirm-sale-info .info-label {
  color: #b0b0b0;
}

.confirm-sale-info .info-value {
  color: #ccc;
}

.confirm-buttons {
  display: flex;
  gap: 12px;
}

.confirm-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-btn-cancel {
  background: rgba(100,100,100,0.3);
  color: #b0b0b0;
}

.confirm-btn-cancel:hover {
  background: rgba(100,100,100,0.5);
  color: #ccc;
}

.confirm-btn-hide {
  background: #5a2828;
  color: #ff6b6b;
}

.confirm-btn-hide:hover {
  background: #6a3030;
}

/* Password Modal */
.password-modal-content {
  background: linear-gradient(135deg, #1e1e28, #14141e);
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 12px;
  padding: 24px;
  max-width: 350px;
  width: 90%;
  text-align: center;
}

.password-title {
  font-size: 18px;
  font-weight: 600;
  color: #d4af37;
  margin-bottom: 16px;
}

.password-input {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 14px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.password-input.error {
  border-color: #e74c3c;
}

.password-error {
  color: #e74c3c;
  font-size: 12px;
  margin-bottom: 12px;
}

.password-buttons {
  display: flex;
  gap: 12px;
}

.password-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.password-btn-cancel {
  background: rgba(100,100,100,0.3);
  color: #b0b0b0;
}

.password-btn-cancel:hover {
  background: rgba(100,100,100,0.5);
  color: #ccc;
}

.password-btn-submit {
  background: rgba(212, 175, 55, 0.3);
  color: #d4af37;
}

.password-btn-submit:hover {
  background: rgba(212, 175, 55, 0.5);
}

/* ============================================================
   PLAYER ANALYTICS PAGE STYLES
   Extracted from islands/PlayerAnalytics.tsx
   ============================================================ */

.player-analytics {
  margin-top: 24px;
}

.analytics-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 8px;
}

.tab-btn {
  padding: 10px 20px;
  background: var(--background-secondary);
  border: 1px solid var(--border-light);
  border-radius: 6px 6px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: var(--background-tertiary);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--apple-blue);
  color: white;
  border-color: var(--apple-blue);
}

.tab-content {
  min-height: 400px;
}

.charts-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.chart-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.chart-container {
  background: var(--background-secondary);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  min-height: 400px;
  position: relative;
}

.chart-container.small {
  min-height: 350px;
}

.chart-container canvas {
  max-height: 100%;
}

.see-all-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 6px 12px;
  background: var(--apple-blue);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}

.see-all-btn:hover {
  background: #0051a8;
  transform: translateY(-1px);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--background-primary);
  border-radius: 8px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
}

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

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--background-tertiary);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

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

.all-players-table th {
  background: var(--background-secondary);
  padding: 12px;
  text-align: left;
  border-bottom: 2px solid var(--border-light);
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.all-players-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.all-players-table tbody tr:hover {
  background: var(--background-secondary);
}

.all-players-table tbody tr:nth-child(1) td:first-child {
  color: #ffd700;
  font-weight: bold;
}

.all-players-table tbody tr:nth-child(2) td:first-child {
  color: #c0c0c0;
  font-weight: bold;
}

.all-players-table tbody tr:nth-child(3) td:first-child {
  color: #cd7f32;
  font-weight: bold;
}

@media (max-width: 1024px) {
  .chart-row {
    grid-template-columns: 1fr;
  }

  .analytics-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    white-space: nowrap;
  }
}

/* ============================================================
   ARCHITECTURE DOCS PAGE STYLES
   Extracted from islands/ArchitectureDocs.tsx
   Conflicts scoped: .stat-value, .stat-label, .flow-arrow
   ============================================================ */
  .arch-container {
    width: 100%;
    max-width: none;
  }
  .last-updated {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
    margin-bottom: 12px;
    font-style: italic;
  }
  .arch-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
  }
  .arch-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--background-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
  }
  .arch-nav-btn:hover {
    background: var(--background-secondary);
    color: var(--text-primary);
    transform: translateY(-1px);
  }
  .arch-nav-btn.active {
    background: var(--apple-blue);
    border-color: var(--apple-blue);
    color: white;
  }
  .arch-nav-icon {
    font-size: 18px;
  }

  .arch-card {
    background: var(--background-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
  }
  .arch-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--background-tertiary);
  }
  .arch-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
  }
  .arch-card-body {
    padding: 20px;
  }

  .stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
  }
  @media (max-width: 768px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
  }
  .stat-item {
    background: linear-gradient(135deg, var(--background-tertiary) 0%, var(--background-secondary) 100%);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
  }
  .arch-container .stat-value {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--apple-blue), var(--apple-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  .arch-container .stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
  }

  .tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
  }
  .tech-card {
    background: var(--background-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
  }
  .tech-card:hover {
    border-color: var(--apple-blue);
    transform: translateY(-2px);
  }
  .tech-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }
  .tech-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
  }
  .tech-icon.blue { background: rgba(87, 148, 242, 0.15); }
  .tech-icon.green { background: rgba(115, 191, 105, 0.15); }
  .tech-icon.purple { background: rgba(184, 119, 217, 0.15); }
  .tech-icon.orange { background: rgba(255, 152, 48, 0.15); }
  .tech-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
  }
  .tech-type {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .tech-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
  }
  .tech-desc code {
    background: var(--background-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--apple-purple);
  }

  /* Visual Flow Diagram */
  .visual-flow {
    background: var(--background-tertiary);
    border-radius: 12px;
    padding: 32px;
    position: relative;
    overflow: hidden;
  }
  .flow-layer {
    background: var(--background-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
  }
  .flow-layer:last-child { margin-bottom: 0; }
  .flow-layer-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    font-weight: 600;
  }
  .flow-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
  }
  .flow-item {
    background: var(--background-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .flow-item.external { border-color: var(--apple-orange); }
  .flow-item.server { border-color: var(--apple-blue); }
  .flow-item.module { border-color: var(--apple-green); }
  .flow-item.db { border-color: var(--apple-purple); }
  .arch-container .flow-arrow {
    text-align: center;
    padding: 8px 0;
    color: var(--text-tertiary);
    font-size: 20px;
  }

  /* ERD Styles */
  .erd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
  }
  .erd-table {
    background: var(--background-tertiary);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-light);
  }
  .erd-header {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .erd-header.blue { background: linear-gradient(135deg, rgba(87, 148, 242, 0.2) 0%, rgba(87, 148, 242, 0.1) 100%); color: var(--apple-blue); border-bottom: 2px solid var(--apple-blue); }
  .erd-header.green { background: linear-gradient(135deg, rgba(115, 191, 105, 0.2) 0%, rgba(115, 191, 105, 0.1) 100%); color: var(--apple-green); border-bottom: 2px solid var(--apple-green); }
  .erd-header.purple { background: linear-gradient(135deg, rgba(184, 119, 217, 0.2) 0%, rgba(184, 119, 217, 0.1) 100%); color: var(--apple-purple); border-bottom: 2px solid var(--apple-purple); }
  .erd-header.orange { background: linear-gradient(135deg, rgba(255, 152, 48, 0.2) 0%, rgba(255, 152, 48, 0.1) 100%); color: var(--apple-orange); border-bottom: 2px solid var(--apple-orange); }
  .erd-fields {
    padding: 12px 0;
  }
  .erd-field {
    padding: 8px 16px;
    font-size: 12px;
    font-family: ui-monospace, monospace;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .erd-field:hover {
    background: var(--background-secondary);
  }
  .erd-field.pk { color: var(--apple-yellow); font-weight: 600; }
  .erd-field.fk { color: var(--apple-blue); }
  .erd-type {
    font-size: 10px;
    color: var(--text-tertiary);
    background: var(--background-secondary);
    padding: 2px 6px;
    border-radius: 4px;
  }

  /* Shared Modules */
  .module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
  }
  .module-card {
    background: linear-gradient(135deg, rgba(115, 191, 105, 0.08) 0%, rgba(115, 191, 105, 0.02) 100%);
    border: 1px solid var(--apple-green);
    border-radius: 12px;
    padding: 20px;
  }
  .module-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }
  .module-icon {
    font-size: 24px;
  }
  .module-name {
    font-weight: 600;
    color: var(--apple-green);
    font-size: 15px;
  }
  .module-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 12px;
  }
  .module-used {
    font-size: 11px;
    color: var(--text-tertiary);
    padding-top: 12px;
    border-top: 1px solid rgba(115, 191, 105, 0.2);
  }
  .module-used strong { color: var(--text-secondary); }

  /* Island Grid */
  .island-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
  }
  .island-card {
    background: var(--background-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
  }
  .island-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
  }
  .island-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(87, 148, 242, 0.15);
  }
  .island-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
  }
  .island-type {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .island-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 14px;
  }
  .island-deps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .island-dep {
    font-size: 10px;
    padding: 4px 8px;
    background: var(--background-secondary);
    border-radius: 4px;
    color: var(--apple-purple);
    font-family: ui-monospace, monospace;
  }

  /* API Table */
  .api-section {
    margin-bottom: 28px;
  }
  .api-section:last-child { margin-bottom: 0; }
  .api-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .api-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
  }
  .api-table th {
    text-align: left;
    padding: 12px 14px;
    background: var(--background-tertiary);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-light);
  }
  .api-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
  }
  .api-table tr:hover td {
    background: var(--background-tertiary);
  }
  .method {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
  }
  .method.get { background: rgba(115, 191, 105, 0.15); color: var(--apple-green); }
  .method.post { background: rgba(87, 148, 242, 0.15); color: var(--apple-blue); }
  .method.put { background: rgba(255, 152, 48, 0.15); color: var(--apple-orange); }
  .method.del { background: rgba(242, 73, 92, 0.15); color: var(--apple-red); }
  .route {
    font-family: ui-monospace, monospace;
    font-size: 12px;
    color: var(--apple-purple);
  }

  /* Flow Steps */
  .flow-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 700px;
    margin: 0 auto;
  }
  .flow-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
  }
  .flow-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--apple-blue), var(--apple-purple));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
  }
  .flow-content {
    flex: 1;
    padding: 14px 18px;
    background: var(--background-secondary);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
  }
  .flow-content code {
    background: var(--background-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--apple-purple);
  }
  .flow-content strong {
    color: var(--text-primary);
  }

  /* Rules Grid */
  .rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
  }
  .rule-card {
    background: var(--background-tertiary);
    border-left: 3px solid var(--apple-blue);
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
  }
  .rule-card.green { border-left-color: var(--apple-green); }
  .rule-card.orange { border-left-color: var(--apple-orange); }
  .rule-card.purple { border-left-color: var(--apple-purple); }
  .rule-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 6px;
  }
  .rule-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
  }
  .rule-desc code {
    background: var(--background-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--apple-purple);
  }

  @media (max-width: 768px) {
    .arch-nav { flex-direction: column; }
    .arch-nav-btn { justify-content: center; }
    .erd-grid, .module-grid, .island-grid, .rules-grid { grid-template-columns: 1fr; }
  }

  /* Visual Diagrams */
  .visual-diagram {
    padding: 20px;
    background: var(--background-secondary);
    border-radius: 8px;
  }

  /* Architecture Diagram Styles */
  .diagram-layer-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
  }

  .diagram-layer {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }

  .diagram-box {
    min-width: 180px;
    padding: 16px 20px;
    border-radius: 8px;
    border: 2px solid;
    text-align: center;
    transition: transform 0.2s;
  }

  .diagram-box:hover {
    transform: translateY(-2px);
  }

  .diagram-box.status-good {
    border-color: var(--apple-green);
    background: linear-gradient(135deg, rgba(115, 191, 105, 0.1) 0%, rgba(115, 191, 105, 0.05) 100%);
  }

  .diagram-box.status-warning {
    border-color: var(--apple-orange);
    background: linear-gradient(135deg, rgba(255, 152, 48, 0.1) 0%, rgba(255, 152, 48, 0.05) 100%);
  }

  .diagram-box.status-error {
    border-color: var(--apple-red);
    background: linear-gradient(135deg, rgba(242, 73, 92, 0.1) 0%, rgba(242, 73, 92, 0.05) 100%);
  }

  .diagram-box-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
  }

  .diagram-box-count {
    font-size: 12px;
    color: var(--text-secondary);
  }

  .diagram-arrow-down {
    text-align: center;
    font-size: 28px;
    color: var(--apple-blue);
    margin: 12px 0;
    font-weight: bold;
  }

  /* Flowchart Diagram Styles */
  .flowchart-diagram svg {
    background: var(--background-secondary);
    border-radius: 8px;
  }

  /* Filesystem Diagram Styles */
  .filesystem-diagram svg {
    background: var(--background-secondary);
    border-radius: 8px;
    padding: 20px;
  }


/* ============================================================
   ATTENDANCE TABS PAGE STYLES
   Extracted from islands/AttendanceTabs.tsx
   All selectors scoped under .attendance-container
   ============================================================ */
        .attendance-container .tab-nav {
          display: flex;
          gap: 8px;
          margin-bottom: 20px;
          border-bottom: 1px solid var(--border-light);
          padding-bottom: 12px;
          flex-wrap: wrap;
        }
        .attendance-container .tab-btn {
          padding: 10px 20px;
          background: transparent;
          border: 1px solid var(--border-light);
          border-radius: 8px;
          color: var(--text-secondary);
          cursor: pointer;
          font-size: 14px;
          font-weight: 500;
          transition: all 0.2s;
          font-family: inherit;
          white-space: nowrap;
        }
        .attendance-container .tab-btn:hover {
          background: var(--background-tertiary);
          color: var(--text-primary);
        }
        .attendance-container .tab-btn.active {
          background: var(--apple-blue);
          border-color: var(--apple-blue);
          color: white;
        }

        /* Mobile responsive tabs */
        @media (max-width: 640px) {
          .attendance-container .tab-nav {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 6px;
          }
          .attendance-container .tab-btn {
            padding: 8px 10px;
            font-size: 12px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
          }
        }

        .attendance-container .stat-grid-3 {
          display: grid;
          grid-template-columns: repeat(3, 1fr);
          gap: 16px;
        }
        @media (max-width: 640px) {
          .stat-grid-3 { grid-template-columns: 1fr; }
        }
        .attendance-container .stat-card {
          background: var(--background-secondary);
          border: 1px solid var(--border-light);
          border-radius: 12px;
          padding: 24px;
          text-align: center;
        }
        .attendance-container .stat-value {
          font-size: 36px;
          font-weight: 700;
          color: var(--apple-blue);
        }
        .attendance-container .stat-label {
          font-size: 12px;
          color: var(--text-tertiary);
          text-transform: uppercase;
          letter-spacing: 0.5px;
          margin-top: 4px;
        }

        .attendance-container .card {
          background: var(--background-secondary);
          border: 1px solid var(--border-light);
          border-radius: 12px;
          overflow: hidden;
        }
        .attendance-container .card-header {
          padding: 16px 20px;
          border-bottom: 1px solid var(--border-light);
          display: flex;
          align-items: center;
          justify-content: space-between;
        }
        .attendance-container .card-title {
          font-size: 16px;
          font-weight: 600;
          color: var(--text-primary);
          margin: 0;
        }
        .attendance-container .card-body {
          padding: 20px;
        }
        .mt-3 { margin-top: 20px; }

        .attendance-container .badge {
          font-size: 12px;
          padding: 4px 10px;
          border-radius: 12px;
          font-weight: 500;
        }
        .attendance-container .badge-green {
          background: rgba(115, 191, 105, 0.15);
          color: var(--apple-green);
        }
        .attendance-container .badge-blue {
          background: rgba(87, 148, 242, 0.15);
          color: var(--apple-blue);
        }

        .attendance-container .raid-type-grid {
          display: grid;
          grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
          gap: 12px;
        }
        .attendance-container .raid-type-card {
          background: var(--background-tertiary);
          border-radius: 8px;
          padding: 12px 16px;
          transition: all 0.2s;
        }
        .attendance-container .raid-type-card:hover {
          background: var(--background-secondary);
          transform: translateY(-2px);
          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }
        .attendance-container .raid-type-name {
          font-weight: 600;
          font-size: 14px;
        }
        .attendance-container .raid-type-count {
          font-size: 12px;
          color: var(--text-tertiary);
          margin-top: 2px;
        }

        .attendance-container .recent-raids-list {
          display: flex;
          flex-direction: column;
          gap: 12px;
        }
        .attendance-container .recent-raid-item {
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding: 12px 16px;
          background: var(--background-tertiary);
          border-radius: 8px;
          transition: all 0.2s;
        }
        .attendance-container .recent-raid-item:hover {
          background: var(--background-secondary);
          transform: translateX(4px);
          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }
        .attendance-container .recent-raid-info {
          display: flex;
          align-items: center;
          gap: 12px;
        }
        .attendance-container .recent-raid-type {
          font-weight: 600;
          font-size: 13px;
          min-width: 60px;
        }
        .attendance-container .recent-raid-name {
          color: var(--text-primary);
          font-size: 14px;
        }
        .attendance-container .recent-raid-meta {
          display: flex;
          align-items: center;
          gap: 16px;
          color: var(--text-tertiary);
          font-size: 13px;
        }
        .attendance-container .recent-raid-players {
          color: var(--text-secondary);
        }

        .attendance-container .table-container {
          overflow-x: auto;
        }
        .attendance-container table {
          width: 100%;
          border-collapse: collapse;
        }
        .attendance-container th, .attendance-container td {
          padding: 12px 16px;
          text-align: left;
          border-bottom: 1px solid var(--border-light);
        }
        .attendance-container th {
          background: var(--background-tertiary);
          font-size: 11px;
          text-transform: uppercase;
          letter-spacing: 0.5px;
          color: var(--text-secondary);
          font-weight: 500;
        }
        .attendance-container tr:hover td {
          background: var(--background-tertiary);
        }

        .attendance-container .raid-type-badges {
          display: flex;
          gap: 4px;
          flex-wrap: wrap;
        }
        .attendance-container .raid-type-badge {
          font-size: 11px;
          padding: 2px 6px;
          border-radius: 4px;
          font-weight: 500;
        }

        .attendance-container .raid-select {
          width: 100%;
          padding: 12px 16px;
          background: var(--background-tertiary);
          border: 1px solid var(--border-light);
          border-radius: 8px;
          color: var(--text-primary);
          font-size: 14px;
          cursor: pointer;
          font-family: inherit;
        }
        .attendance-container .raid-select:focus {
          outline: none;
          border-color: var(--apple-blue);
        }

        .attendance-container .raid-date-display {
          font-size: 13px;
          color: var(--text-secondary);
          margin-bottom: 12px;
          padding-bottom: 8px;
          border-bottom: 1px solid var(--border-light);
        }

        .attendance-container .roster-grid {
          display: grid;
          grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
          gap: 8px;
        }
        .attendance-container .roster-player {
          padding: 10px 14px;
          background: var(--background-tertiary);
          border-radius: 6px;
          font-size: 13px;
          color: var(--text-primary);
        }

        .attendance-container .empty-state {
          text-align: center;
          padding: 48px 20px;
          color: var(--text-tertiary);
        }

        .attendance-container .clickable {
          cursor: pointer;
        }

        .attendance-container .class-groups {
          display: grid;
          grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
          gap: 12px;
        }

        .attendance-container .class-group {
          background: var(--background-tertiary);
          border-radius: 6px;
          overflow: hidden;
        }

        .attendance-container .class-group-header {
          display: flex;
          align-items: center;
          gap: 6px;
          padding: 8px 12px;
          background: var(--background-secondary);
          border-left: 3px solid var(--apple-blue);
          font-weight: 600;
        }

        .attendance-container .class-group-icon {
          font-size: 16px;
        }

        .attendance-container .class-group-name {
          font-size: 12px;
          letter-spacing: 0.5px;
          flex: 1;
        }

        .attendance-container .class-group-count {
          color: var(--text-tertiary);
          font-size: 11px;
          font-weight: 500;
        }

        .attendance-container .class-group-players {
          display: flex;
          flex-direction: column;
          gap: 3px;
          padding: 8px;
        }

        .attendance-container .class-player-item {
          display: flex;
          align-items: center;
          gap: 5px;
          padding: 5px 8px;
          background: var(--background-secondary);
          border-radius: 4px;
          font-size: 12px;
          transition: all 0.15s;
        }

        .attendance-container .class-player-item:hover {
          background: var(--bg-tertiary);
          transform: translateX(3px);
        }

        .attendance-container .player-spec {
          color: var(--text-tertiary);
          font-size: 10px;
          font-weight: 500;
        }

        .attendance-container .player-name {
          font-weight: 500;
        }

        .attendance-container .filter-clear-btn {
          padding: 6px 12px;
          background: rgba(255, 149, 0, 0.15);
          border: 1px solid var(--apple-orange);
          border-radius: 6px;
          color: var(--apple-orange);
          font-size: 12px;
          font-weight: 500;
          cursor: pointer;
          transition: all 0.2s;
          font-family: inherit;
        }
        .attendance-container .filter-clear-btn:hover {
          background: rgba(255, 149, 0, 0.25);
        }

        /* Player Detail Panel */
        .attendance-container .player-panel-overlay {
          position: fixed;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          background: rgba(0, 0, 0, 0.7);
          z-index: 1000;
          animation: fadeIn 0.2s;
        }

        .attendance-container .player-panel {
          position: fixed;
          top: 0;
          right: 0;
          bottom: 0;
          width: 400px;
          max-width: 90vw;
          background: var(--background-primary);
          border-left: 1px solid var(--border-light);
          z-index: 1001;
          display: flex;
          flex-direction: column;
          animation: slideIn 0.3s ease-out;
          box-shadow: -4px 0 12px rgba(0, 0, 0, 0.3);
        }

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

        @keyframes slideIn {
          from { transform: translateX(100%); }
          to { transform: translateX(0); }
        }

        .attendance-container .player-panel-header {
          display: flex;
          justify-content: space-between;
          align-items: flex-start;
          padding: 20px;
          border-bottom: 1px solid var(--border-light);
          background: var(--background-secondary);
        }

        .attendance-container .player-panel-title {
          margin: 0;
          font-size: 20px;
          font-weight: 600;
          display: flex;
          align-items: center;
          gap: 8px;
        }

        .attendance-container .player-panel-class {
          font-size: 14px;
          color: var(--text-secondary);
          margin-top: 4px;
        }

        .attendance-container .player-panel-spec {
          color: var(--text-tertiary);
        }

        .attendance-container .player-panel-close {
          background: transparent;
          border: none;
          color: var(--text-secondary);
          font-size: 24px;
          cursor: pointer;
          padding: 4px 8px;
          line-height: 1;
          transition: all 0.2s;
        }

        .attendance-container .player-panel-close:hover {
          color: var(--text-primary);
          background: rgba(255, 255, 255, 0.1);
          border-radius: 4px;
        }

        .attendance-container .player-panel-body {
          flex: 1;
          overflow-y: auto;
          padding: 20px;
        }

        .attendance-container .player-panel-section {
          margin-bottom: 24px;
        }

        .attendance-container .player-panel-section:last-child {
          margin-bottom: 0;
        }

        .attendance-container .player-panel-section-title {
          font-size: 14px;
          font-weight: 600;
          margin: 0 0 12px 0;
          color: var(--text-primary);
        }

        .attendance-container .player-panel-stats {
          display: grid;
          grid-template-columns: repeat(3, 1fr);
          gap: 12px;
        }

        .attendance-container .player-stat {
          background: var(--background-tertiary);
          padding: 12px;
          border-radius: 6px;
          text-align: center;
        }

        .attendance-container .player-stat-label {
          display: block;
          font-size: 11px;
          color: var(--text-tertiary);
          margin-bottom: 4px;
          text-transform: uppercase;
          letter-spacing: 0.5px;
        }

        .attendance-container .player-stat-value {
          display: block;
          font-size: 18px;
          font-weight: 600;
          color: var(--text-primary);
        }

        .attendance-container .player-panel-raid-types {
          display: flex;
          flex-direction: column;
          gap: 8px;
        }

        .attendance-container .player-raid-type-item {
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding: 8px 12px;
          background: var(--background-tertiary);
          border-radius: 6px;
          font-size: 13px;
        }

        .attendance-container .player-raid-type-count {
          color: var(--text-tertiary);
          font-size: 12px;
        }

        .attendance-container .player-panel-recent-raids {
          display: flex;
          flex-direction: column;
          gap: 8px;
        }

        .attendance-container .player-recent-raid-item {
          display: flex;
          gap: 8px;
          padding: 8px 12px;
          background: var(--background-tertiary);
          border-radius: 6px;
          font-size: 12px;
          align-items: center;
        }

        .attendance-container .player-recent-raid-date {
          color: var(--text-tertiary);
          min-width: 80px;
        }

        .attendance-container .player-recent-raid-name {
          color: var(--text-secondary);
          flex: 1;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      

/* ==================== ClaudeChat.tsx extracted styles ==================== */

.claude-chat {
          background: var(--bg-secondary);
          border: 2px solid var(--border);
          border-radius: 8px;
          padding: 1.5rem;
          display: flex;
          flex-direction: column;
          height: 600px;
          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }

        .chat-header {
          display: flex;
          justify-content: space-between;
          align-items: center;
          margin-bottom: 1rem;
          padding-bottom: 1rem;
          border-bottom: 1px solid var(--border);
        }

        .chat-header h3 {
          margin: 0;
          color: var(--text-primary);
        }

        .chat-actions {
          display: flex;
          gap: 0.5rem;
        }

        .preview-btn,
        .clear-btn {
          padding: 0.5rem 1rem;
          border: none;
          border-radius: 4px;
          font-size: 0.85rem;
          cursor: pointer;
          transition: opacity 0.2s;
        }

        .preview-btn {
          background: var(--apple-blue);
          color: white;
        }

        .clear-btn {
          background: var(--bg-tertiary);
          color: var(--text-secondary);
        }

        .preview-btn:hover:not(:disabled),
        .clear-btn:hover {
          opacity: 0.8;
        }

        .preview-btn:disabled {
          opacity: 0.5;
          cursor: not-allowed;
        }

        .messages-container {
          flex: 1;
          overflow-y: auto;
          margin-bottom: 1rem;
          padding: 1rem;
          background: var(--bg-tertiary);
          border-radius: 6px;
          border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .empty-chat {
          text-align: center;
          padding: 2rem;
          color: var(--text-secondary);
        }

        .empty-chat .hint {
          margin-top: 1.5rem;
          font-size: 0.9rem;
        }

        .example-prompts {
          list-style: none;
          padding: 0;
          margin: 1rem auto;
          max-width: 400px;
          text-align: left;
        }

        .example-prompts li {
          padding: 0.5rem;
          margin: 0.5rem 0;
          background: var(--bg-secondary);
          border-left: 3px solid var(--apple-blue);
          border-radius: 4px;
          font-size: 0.85rem;
          font-style: italic;
        }

        .message {
          margin-bottom: 1.5rem;
        }

        .message-role {
          font-size: 0.75rem;
          font-weight: 700;
          text-transform: uppercase;
          letter-spacing: 0.5px;
          margin-bottom: 0.5rem;
        }

        .message.user .message-role {
          color: var(--apple-green);
        }

        .message.assistant .message-role {
          color: var(--apple-blue);
        }

        .message-content {
          padding: 1rem;
          border-radius: 6px;
          line-height: 1.6;
          white-space: pre-wrap;
        }

        .message.user .message-content {
          background: rgba(48, 209, 88, 0.1);
          border-left: 3px solid var(--apple-green);
        }

        .message.assistant .message-content {
          background: rgba(59, 130, 246, 0.1);
          border-left: 3px solid var(--apple-blue);
        }

        .chat-error {
          padding: 0.75rem;
          background: rgba(255, 69, 58, 0.1);
          border: 1px solid var(--apple-red);
          border-radius: 4px;
          color: var(--apple-red);
          margin-bottom: 1rem;
        }

        .chat-input-container {
          display: flex;
          gap: 0.75rem;
        }

        .chat-input {
          flex: 1;
          padding: 0.75rem;
          background: #1a1a1a;
          border: 2px solid var(--apple-blue);
          border-radius: 6px;
          color: var(--text-primary);
          font-family: inherit;
          font-size: 0.9rem;
          resize: vertical;
          box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
        }

        .chat-input:focus {
          outline: none;
          border-color: var(--apple-blue);
          box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
        }

        .chat-input:disabled {
          opacity: 0.5;
          cursor: not-allowed;
        }

        .send-btn {
          padding: 0.75rem 1.5rem;
          background: var(--apple-blue);
          color: white;
          border: none;
          border-radius: 6px;
          font-weight: 600;
          cursor: pointer;
          transition: opacity 0.2s;
          align-self: flex-end;
        }

        .send-btn:hover:not(:disabled) {
          opacity: 0.8;
        }

        .send-btn:disabled {
          opacity: 0.5;
          cursor: not-allowed;
        }

        .quick-prompts {
          margin-bottom: 1rem;
          padding: 1rem;
          background: var(--bg-tertiary);
          border: 1px solid rgba(255, 255, 255, 0.1);
          border-radius: 6px;
        }

        .prompts-header {
          font-size: 0.85rem;
          font-weight: 600;
          color: var(--text-secondary);
          margin-bottom: 0.75rem;
          text-transform: uppercase;
          letter-spacing: 0.5px;
        }

        .prompts-grid {
          display: grid;
          grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
          gap: 0.5rem;
        }

        .prompt-btn {
          padding: 0.75rem;
          background: var(--bg-secondary);
          border: 2px solid var(--border);
          border-radius: 6px;
          color: var(--text-primary);
          font-size: 0.85rem;
          text-align: left;
          cursor: pointer;
          transition: all 0.2s;
          line-height: 1.4;
        }

        .prompt-btn:hover:not(:disabled) {
          border-color: var(--apple-blue);
          background: rgba(59, 130, 246, 0.1);
          transform: translateY(-2px);
          box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }

        .prompt-btn:disabled {
          opacity: 0.5;
          cursor: not-allowed;
        }

/* ==================== HerbSales.tsx extracted styles ==================== */

.herbs-container { max-width: 1200px; margin: 0 auto; padding: 15px; }
        .demand-herbs-banner { background: linear-gradient(135deg, rgba(245, 166, 35, 0.08), rgba(234, 88, 12, 0.08)); border: 1px solid rgba(245, 166, 35, 0.25); border-radius: 12px; padding: 16px; margin-bottom: 16px; position: relative; z-index: 101; }
        .demand-herbs-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 4px; }
        .demand-herbs-title { font-size: 1rem; font-weight: 700; color: #f5a623; }
        .demand-herbs-subtitle { font-size: 0.78rem; color: #9ca3af; width: 100%; }
        .demand-herbs-sync { font-size: 0.72rem; color: #6b7280; font-style: italic; width: 100%; }
        .demand-herbs-link { font-size: 0.8rem; color: rgba(255,255,255,0.5); text-decoration: none; }
        .demand-herbs-link:hover { color: #f5a623; }
        .demand-herbs-list { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 4px; }
        .demand-herb-item { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 8px 12px; min-width: 150px; }
        .demand-herb-icon { width: 32px; height: 32px; border-radius: 4px; flex-shrink: 0; }
        .demand-herb-icon-fallback { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
        .demand-herb-info { display: flex; flex-direction: column; min-width: 0; }
        .demand-herb-name { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .demand-herb-level { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.05em; padding: 1px 6px; border-radius: 4px; display: inline-block; width: fit-content; }
        .demand-herb-level.critical { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
        .demand-herb-level.med { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
        .demand-herb-level.low { background: rgba(107, 114, 128, 0.2); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.3); }

        /* Pinned Materials (admin-managed) */
        .pinned-separator { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; font-size: 0.78rem; color: rgba(255,255,255,0.45); }
        .pinned-separator::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.1); }
        .pinned-herbs-list { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 4px; }
        .pinned-herb-item { position: relative; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 8px 12px; min-width: 150px; flex-shrink: 0; }
        .demand-herb-level.clickable { cursor: pointer; border-style: dashed; transition: filter 0.15s, border-color 0.15s; }
        .demand-herb-level.clickable:hover { filter: brightness(1.3); border-color: rgba(255,255,255,0.4); }
        .demand-herb-level.clickable .level-cycle-icon { font-size: 0.55rem; margin-left: 3px; opacity: 0.7; }
        .pinned-herb-remove { position: absolute; top: 4px; right: 6px; background: none; border: none; color: rgba(255,255,255,0.35); font-size: 0.85rem; cursor: pointer; padding: 0 3px; line-height: 1; transition: color 0.15s; }
        .pinned-herb-remove:hover { color: #f87171; }
        .pin-add-form { margin-top: 6px; }
        .pin-add-separator { display: flex; align-items: center; gap: 10px; margin: 10px 0 8px; font-size: 0.75rem; color: rgba(255,255,255,0.35); }
        .pin-add-separator::before, .pin-add-separator::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.08); }
        .pin-add-row { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
        .pin-search-container { position: relative; flex: 1; min-width: 200px; z-index: 101; }
        .pin-search-input { width: 100%; padding: 8px 12px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; color: white; font-size: 0.85rem; outline: none; }
        .pin-search-input:focus { border-color: rgba(245, 166, 35, 0.5); }
        .pin-search-input::placeholder { color: rgba(255,255,255,0.3); }
        .pin-search-results { position: absolute; top: 100%; left: 0; right: 0; background: #1f2937; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; margin-top: 4px; max-height: 200px; overflow-y: auto; z-index: 200; }
        .pin-search-result-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; transition: background 0.15s; font-size: 0.85rem; color: rgba(255,255,255,0.85); }
        .pin-search-result-item:hover { background: rgba(245, 166, 35, 0.12); }
        .pin-search-result-icon { width: 24px; height: 24px; border-radius: 3px; flex-shrink: 0; }
        .pin-level-selector { display: flex; gap: 6px; align-items: center; }
        .pin-level-option { display: flex; align-items: center; gap: 4px; cursor: pointer; }
        .pin-level-option input[type="radio"] { accent-color: #f5a623; cursor: pointer; }
        .pin-level-option label { font-size: 0.75rem; font-weight: 600; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
        .pin-level-option label.critical-label { color: #f87171; background: rgba(239, 68, 68, 0.15); }
        .pin-level-option label.med-label { color: #fbbf24; background: rgba(245, 158, 11, 0.15); }
        .pin-level-option label.low-label { color: #9ca3af; background: rgba(107, 114, 128, 0.15); }
        .pin-level-option input:checked + label.critical-label { background: rgba(239, 68, 68, 0.3); border: 1px solid rgba(239, 68, 68, 0.4); }
        .pin-level-option input:checked + label.med-label { background: rgba(245, 158, 11, 0.3); border: 1px solid rgba(245, 158, 11, 0.4); }
        .pin-level-option input:checked + label.low-label { background: rgba(107, 114, 128, 0.3); border: 1px solid rgba(107, 114, 128, 0.4); }

        .herbs-header { text-align: center; margin-bottom: 20px; }
        .herbs-header h1 { color: #4ade80; font-size: 1.8rem; margin-bottom: 8px; }
        .discount-badge { background: linear-gradient(135deg, #065f46, #047857); color: white; padding: 8px 20px; border-radius: 20px; font-size: 1.1rem; display: inline-block; }
        .discount-badge.editable { display: inline-flex; align-items: center; gap: 10px; }
        .discount-input { width: 60px; padding: 4px 8px; border: 1px solid #4ade80; border-radius: 4px; background: rgba(0,0,0,0.3); color: white; font-size: 1rem; text-align: center; }
        .discount-save-btn { padding: 4px 12px; background: #4ade80; color: #111827; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; font-size: 0.85rem; }
        .discount-save-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .discount-save-msg { font-size: 0.85rem; padding: 4px 8px; border-radius: 4px; }
        .discount-save-msg.success { background: rgba(74, 222, 128, 0.3); color: #4ade80; }
        .discount-save-msg.error { background: rgba(239, 68, 68, 0.3); color: #ef4444; }
        .dynamic-toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.9rem; white-space: nowrap; }
        .dynamic-toggle input[type="checkbox"] { accent-color: #4ade80; width: 16px; height: 16px; }
        .tier-discount-controls { display: flex; flex-wrap: wrap; gap: 6px 12px; }
        .tier-discount-row { display: flex; align-items: center; gap: 4px; font-size: 0.8rem; white-space: nowrap; }
        .tier-label { color: #d4d4d4; min-width: 90px; }
        .tier-discount-input { width: 42px; padding: 2px 4px; border: 1px solid #4ade80; border-radius: 3px; background: rgba(0,0,0,0.3); color: white; font-size: 0.85rem; text-align: center; }
        .tier-pct { color: #a0a0a0; }
        .flat-discount-control { display: flex; align-items: center; gap: 6px; }
        .discount-badge.editable { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; }
        .header-actions { margin-top: 10px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
        .refresh-btn { background: linear-gradient(135deg, #065f46, #047857); color: white; padding: 10px 20px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s; font-size: 0.9rem; position: relative; overflow: hidden; }
        .refresh-btn:hover { background: linear-gradient(135deg, #047857, #059669); transform: translateY(-2px); }
        .refresh-btn:disabled { opacity: 1; cursor: not-allowed; transform: none; color: #d1fae5; }
        .refresh-progress-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(74,222,128,0.25), rgba(74,222,128,0.4)); border-radius: 8px; transition: width 0.5s ease; pointer-events: none; }
        .cart-btn { background: linear-gradient(135deg, #4ade80, #22c55e); color: #111827; padding: 10px 20px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s; }
        .cart-btn:hover { background: linear-gradient(135deg, #22c55e, #16a34a); transform: translateY(-2px); }
        .cart-badge { background: #111827; color: #4ade80; border-radius: 50%; min-width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: bold; }
        .admin-toggle { background: #2a2a2a; border: 1px solid #4a4a4a; color: #9ca3af; padding: 10px 20px; border-radius: 8px; cursor: pointer; transition: all 0.2s; font-size: 0.9rem; }
        .admin-toggle:hover { border-color: #4ade80; }
        .admin-toggle.active { background: linear-gradient(135deg, #065f46, #047857); border-color: #4ade80; color: #4ade80; }
        .last-updated-banner { background: #2a2a2a; border: 1px solid #4a4a4a; border-radius: 8px; padding: 10px 20px; margin-top: 15px; display: inline-block; }
        .last-updated-banner .label { color: #808080; font-size: 0.9rem; }
        .last-updated-banner .time { color: #4ade80; font-weight: bold; margin-left: 8px; }
        .last-updated-banner .relative { color: #22c55e; margin-left: 8px; font-size: 0.9rem; }

        .sticky-toolbar { position: sticky; top: 75px; z-index: 100; background: linear-gradient(180deg, rgba(26,26,26,0.95) 0%, rgba(26,26,26,0.95) 90%, transparent 100%); padding: 12px 0 12px 0; margin: 0 -15px; padding-left: 15px; padding-right: 15px; }
        .sticky-toolbar::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 10px; background: #1a1a1a; z-index: -1; }
        .toolbar-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 12px; }
        .search-container { position: relative; flex: 1; min-width: 200px; max-width: 400px; }
        .search-input { width: 100%; padding: 10px 40px 10px 38px; background: #2a2a2a; border: 2px solid #4a4a4a; border-radius: 8px; color: #4ade80; font-size: 0.95rem; outline: none; transition: border-color 0.2s; box-sizing: border-box; }
        .search-input:focus { border-color: #4ade80; }
        .search-input::placeholder { color: #666; }
        .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #666; pointer-events: none; font-size: 1rem; }
        .search-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #666; cursor: pointer; font-size: 1.1rem; padding: 2px 6px; }
        .search-clear:hover { color: #4ade80; }
        .search-results { position: absolute; top: 100%; left: 0; right: 0; background: #1a1a1a; border: 2px solid #4ade80; border-top: none; border-radius: 0 0 8px 8px; max-height: 350px; overflow-y: auto; z-index: 1000; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
        .search-results-header { padding: 8px 12px; font-size: 0.75rem; color: #808080; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #3a3a3a; }
        .search-result-item { padding: 10px 12px; cursor: pointer; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #3a3a3a; transition: background 0.2s; }
        .search-result-item:hover { background: #2a2a2a; }
        .search-result-item:last-child { border-bottom: none; }
        .search-result-icon { width: 32px; height: 32px; border-radius: 4px; border: 1px solid #4a4a4a; flex-shrink: 0; }
        .search-result-icon-placeholder { width: 32px; height: 32px; border-radius: 4px; border: 1px solid #4a4a4a; background: #2a2a2a; display: flex; align-items: center; justify-content: center; color: #666; font-size: 0.8rem; flex-shrink: 0; }
        .search-result-info { flex: 1; min-width: 0; }
        .search-result-name { color: #4ade80; font-weight: bold; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .search-result-price { color: #fbbf24; font-weight: bold; font-size: 0.85rem; white-space: nowrap; margin-right: 8px; }
        .search-result-add { padding: 5px 10px; background: linear-gradient(135deg, #065f46, #047857); border: none; border-radius: 5px; color: white; font-size: 0.75rem; font-weight: bold; cursor: pointer; white-space: nowrap; transition: all 0.2s; }
        .search-result-add:hover { background: linear-gradient(135deg, #047857, #059669); transform: scale(1.05); }
        .search-result-add:disabled { background: #4a4a4a; cursor: not-allowed; transform: none; }
        .search-result-add.added { background: linear-gradient(135deg, #047857, #065f46); }
        .search-result-no-price { color: #666; font-size: 0.8rem; font-style: italic; }

        .category-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: thin; }
        .category-tab { padding: 6px 14px; background: #2a2a2a; border: 2px solid #4a4a4a; border-radius: 6px; color: #9ca3af; cursor: pointer; transition: all 0.2s; font-size: 0.85rem; white-space: nowrap; flex-shrink: 0; }
        .category-tab:hover { border-color: #4ade80; }
        .category-tab.active { background: linear-gradient(135deg, #3d3d3d, #2a2a2a); border-color: #4ade80; color: #4ade80; }

        .items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; max-width: 1200px; }
        @media (min-width: 1200px) { .items-grid { grid-template-columns: repeat(4, 1fr); } }
        .item-card { background: #2a2a2a; border: 1px solid #4a4a4a; border-radius: 8px; padding: 10px; transition: all 0.2s; }
        .item-card:hover { border-color: #4ade80; transform: translateY(-2px); }
        .item-card.in-cart { border-color: #4ade80; box-shadow: 0 0 10px rgba(74, 222, 128, 0.3); }
        .item-card.highlight { animation: highlightPulse 1.5s ease-out; }
        @keyframes highlightPulse { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); border-color: #4ade80; } 70% { box-shadow: 0 0 0 15px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
        .item-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; padding-right: 55px; }
        .item-icon { width: 40px; height: 40px; border-radius: 4px; border: 2px solid #4a4a4a; background: #1a1a1a; flex-shrink: 0; image-rendering: pixelated; }
        .item-icon-placeholder { width: 40px; height: 40px; border-radius: 4px; border: 2px solid #4a4a4a; background: linear-gradient(135deg, #3a3a3a, #2a2a2a); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #666; font-size: 1rem; }
        a.item-name { color: #4ade80; font-weight: bold; font-size: 1rem; line-height: 1.3; text-decoration: none; transition: color 0.2s; overflow: hidden; text-overflow: ellipsis; }
        a.item-name:hover { color: #22c55e; text-decoration: underline; }
        .item-prices { margin: 8px 0; }
        .shop-price { font-size: 1.2rem; color: #fbbf24; font-weight: bold; }
        .ah-price { color: #808080; font-size: 0.85rem; margin-left: 8px; }
        .no-price { color: #808080; font-style: italic; }
        .add-to-cart-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
        .qty-control { display: flex; align-items: center; background: #3a3a3a; border-radius: 6px; overflow: visible; flex-shrink: 0; min-width: 110px; }
        .qty-btn { width: 28px; height: 28px; border: none; background: transparent; color: #4ade80; font-size: 1.1rem; cursor: pointer; transition: background 0.2s; }
        .qty-btn:hover { background: rgba(255,255,255,0.1); }
        .qty-input { width: 50px; text-align: center; border: none; background: transparent; color: #4ade80; font-size: 0.95rem; -moz-appearance: textfield; appearance: textfield; padding: 4px 2px; }
        .qty-input::-webkit-inner-spin-button, .qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
        .add-btn { flex: 1; padding: 6px 10px; background: linear-gradient(135deg, #065f46, #047857); border: none; border-radius: 6px; color: white; font-weight: bold; cursor: pointer; transition: all 0.2s; font-size: 0.9rem; }
        .add-btn:hover { background: linear-gradient(135deg, #047857, #059669); }
        .add-btn:disabled { background: #4a4a4a; cursor: not-allowed; }
        .remove-btn { flex: 1; padding: 6px 10px; background: transparent; border: 1px solid #ef4444; border-radius: 6px; color: #ef4444; font-weight: bold; cursor: pointer; transition: all 0.2s; font-size: 0.9rem; }
        .remove-btn:hover { background: rgba(239, 68, 68, 0.2); }
        .in-cart-indicator { color: #4ade80; font-size: 0.8rem; margin-top: 6px; }

        .cart-overlay { position: fixed; top: 95px; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.8); z-index: 1100; display: flex; justify-content: flex-end; }
        .cart-panel { width: 340px; max-width: 100%; background: #1a1a1a; height: 100%; display: flex; flex-direction: column; border-left: 2px solid #4ade80; }
        .cart-header { padding: 12px 15px; border-bottom: 1px solid #4a4a4a; display: flex; justify-content: space-between; align-items: center; }
        .cart-header h2 { color: #4ade80; margin: 0; font-size: 1.1rem; }
        .close-btn { background: none; border: none; color: #9ca3af; font-size: 1.5rem; cursor: pointer; }
        .cart-items { flex: 1; overflow-y: auto; padding: 10px; }
        .cart-item { background: #2a2a2a; border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; }
        .cart-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
        .cart-item-name { color: #4ade80; font-weight: bold; }
        .cart-item-remove { background: none; border: none; color: #ef4444; cursor: pointer; font-size: 1rem; }
        .cart-item-details { display: flex; justify-content: space-between; align-items: center; }
        .cart-item-price { color: #fbbf24; font-weight: bold; }
        .cart-item-qty { display: flex; align-items: center; gap: 8px; }
        .cart-item-qty input { width: 50px; padding: 4px; text-align: center; background: #3a3a3a; border: 1px solid #4a4a4a; border-radius: 4px; color: #4ade80; }
        .cart-empty { text-align: center; color: #808080; padding: 40px 20px; }
        .cart-footer { padding: 12px 15px; border-top: 1px solid #4a4a4a; }
        .cart-notes { margin-bottom: 10px; }
        .cart-notes label { display: block; color: #9ca3af; margin-bottom: 3px; font-size: 0.8rem; }
        .cart-notes input, .cart-notes select, .cart-notes textarea { width: 100%; padding: 8px; background: #2a2a2a; border: 1px solid #4a4a4a; border-radius: 5px; color: #4ade80; box-sizing: border-box; font-size: 0.85rem; }
        .cart-notes input:focus, .cart-notes select:focus, .cart-notes textarea:focus { outline: none; border-color: #4ade80; }
        .login-required-box { text-align: center; padding: 12px; background: rgba(74, 222, 128, 0.1); border: 1px dashed #4ade80; border-radius: 6px; margin-bottom: 10px; }
        .login-required-box p { color: #9ca3af; margin-bottom: 10px; font-size: 0.85rem; }
        .discord-login-btn { display: inline-flex; align-items: center; gap: 6px; background: #5865F2; color: white; padding: 8px 16px; border-radius: 5px; text-decoration: none; font-weight: bold; font-size: 0.85rem; transition: background 0.2s; }
        .discord-login-btn:hover { background: #4752C4; }
        .discord-user-display { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #2a2a2a; border: 1px solid #4ade80; border-radius: 5px; }
        .discord-name { color: #4ade80; font-weight: bold; font-size: 0.9rem; }
        .discord-tag { color: #5865F2; font-size: 0.75rem; background: rgba(88, 101, 242, 0.2); padding: 2px 6px; border-radius: 3px; }
        .cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 1rem; }
        .cart-total-label { color: #9ca3af; font-size: 0.9rem; }
        .cart-total-value { color: #fbbf24; font-weight: bold; font-size: 1.1rem; }
        .checkout-btn { width: 100%; padding: 10px; background: linear-gradient(135deg, #4ade80, #22c55e); border: none; border-radius: 6px; color: #111827; font-size: 0.95rem; font-weight: bold; cursor: pointer; transition: all 0.2s; }
        .checkout-btn:hover { background: linear-gradient(135deg, #22c55e, #16a34a); }
        .checkout-btn:disabled { background: #4a4a4a; color: #666; cursor: not-allowed; }
        .clear-cart-btn { width: 100%; padding: 8px; background: transparent; border: 1px solid #4a4a4a; border-radius: 5px; color: #9ca3af; margin-top: 8px; cursor: pointer; font-size: 0.85rem; }
        .clear-cart-btn:hover { border-color: #ef4444; color: #ef4444; }

        .herbs-container .status-message { text-align: center; padding: 15px; border-radius: 8px; margin-bottom: 20px; }
        .herbs-container .status-success { background: rgba(74, 222, 128, 0.2); color: #4ade80; border: 1px solid #4ade80; }
        .herbs-container .status-error { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid #ef4444; }

        .admin-bar { background: linear-gradient(135deg, #065f46, #047857); border: 1px solid #4ade80; border-radius: 10px; padding: 15px 20px; margin-bottom: 20px; }
        .admin-bar-title { color: #4ade80; font-weight: bold; font-size: 1.1rem; margin-bottom: 15px; }
        .alchemist-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }
        .alchemist-row { display: flex; align-items: center; gap: 10px; padding: 10px; background: rgba(0,0,0,0.3); border-radius: 6px; }
        .alchemist-row.inactive { opacity: 0.5; }
        .alchemist-name { flex: 1; color: white; font-weight: 500; }
        .alchemist-discord-id { color: #6b7280; font-size: 0.75rem; }
        .alchemist-status { font-size: 0.8rem; padding: 2px 8px; border-radius: 4px; }
        .alchemist-status.active { background: rgba(74, 222, 128, 0.3); color: #4ade80; }
        .alchemist-status.inactive { background: rgba(239, 68, 68, 0.3); color: #ef4444; }
        .alchemist-actions { display: flex; gap: 5px; }
        .alchemist-action-btn { padding: 4px 8px; font-size: 0.75rem; border: none; border-radius: 4px; cursor: pointer; }
        .alchemist-action-btn.edit { background: rgba(74, 222, 128, 0.3); color: #4ade80; }
        .alchemist-action-btn.toggle { background: rgba(255,255,255,0.1); color: white; }
        .alchemist-action-btn.delete { background: rgba(239, 68, 68, 0.3); color: #ef4444; }
        .alchemist-action-btn:hover { opacity: 0.8; }
        .add-alchemist-form { background: rgba(0,0,0,0.3); border-radius: 8px; padding: 15px; }
        .add-alchemist-form input { width: 100%; padding: 8px 12px; background: #1a1a1a; border: 1px solid #4a4a4a; border-radius: 6px; color: white; margin-bottom: 10px; box-sizing: border-box; }
        .add-alchemist-form input:focus { outline: none; border-color: #4ade80; }
        .add-alchemist-buttons { display: flex; gap: 10px; }
        .add-alchemist-btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-weight: 500; }
        .add-alchemist-btn.primary { background: #4ade80; color: #111827; }
        .add-alchemist-btn.secondary { background: #4a4a4a; color: white; }
        .add-alchemist-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .add-alchemist-error { color: #ef4444; font-size: 0.85rem; margin-bottom: 10px; }
        .show-add-btn { background: rgba(74, 222, 128, 0.2); border: 1px dashed rgba(74, 222, 128, 0.5); color: #4ade80; padding: 10px; border-radius: 6px; cursor: pointer; width: 100%; font-size: 0.9rem; }
        .show-add-btn:hover { background: rgba(74, 222, 128, 0.3); }
        .discord-search-container { position: relative; margin-bottom: 10px; }
        .discord-search-input { width: 100%; padding: 8px 12px; background: #1a1a1a; border: 1px solid #4ade80; border-radius: 6px; color: white; box-sizing: border-box; }
        .discord-search-results { position: absolute; top: 100%; left: 0; right: 0; background: #1a1a1a; border: 1px solid #4a4a4a; border-radius: 6px; margin-top: 4px; max-height: 200px; overflow-y: auto; z-index: 50; }
        .discord-member-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid #3a3a3a; }
        .discord-member-item:hover { background: rgba(74, 222, 128, 0.2); }
        .discord-member-avatar { width: 32px; height: 32px; border-radius: 50%; background: #4a4a4a; }
        .discord-member-info { flex: 1; }
        .discord-member-name { color: white; font-weight: 500; }
        .discord-member-username { color: #6b7280; font-size: 0.8rem; }
        .discord-search-hint { color: #6b7280; font-size: 0.8rem; margin-bottom: 5px; }
        .form-divider { border-top: 1px solid #4a4a4a; margin: 10px 0; padding-top: 10px; color: #6b7280; font-size: 0.8rem; }

        .herbs-container .modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.8); display: flex; align-items: center; justify-content: center; z-index: 1000; }
        .herbs-container .modal-content { background: #1a1a1a; border: 2px solid #4ade80; border-radius: 15px; padding: 30px; max-width: 400px; width: 90%; }
        .herbs-container .modal-header { text-align: center; margin-bottom: 20px; }
        .herbs-container .modal-header h2 { color: #4ade80; margin-bottom: 5px; }
        .herbs-container .modal-body { margin-bottom: 20px; }
        .herbs-container .form-group { margin-bottom: 15px; }
        .herbs-container .form-group label { display: block; color: #9ca3af; margin-bottom: 5px; }
        .herbs-container .form-group input { width: 100%; padding: 10px; background: #2a2a2a; border: 1px solid #4a4a4a; border-radius: 6px; color: #4ade80; box-sizing: border-box; }
        .herbs-container .form-group input.error { border-color: #ef4444; }
        .herbs-container .form-group .error-text { color: #ef4444; font-size: 0.85rem; margin-top: 5px; }
        .herbs-container .modal-actions { display: flex; gap: 10px; }
        .herbs-container .modal-actions button { flex: 1; padding: 12px; border-radius: 6px; font-weight: bold; cursor: pointer; border: none; }
        .herbs-container .btn-cancel { background: #2a2a2a; color: #9ca3af; border: 1px solid #4a4a4a !important; }
        .herbs-container .btn-confirm { background: linear-gradient(135deg, #4ade80, #22c55e); color: #111827; }
        .herbs-container .loading, .herbs-container .error { text-align: center; padding: 40px; color: #9ca3af; }
        @media (max-width: 768px) { .herbs-header h1 { font-size: 1.8rem; } .items-grid { grid-template-columns: 1fr; } .cart-panel { width: 100%; } }

/* ==================== ConsumesShop.tsx extracted styles ==================== */

        .consumes-container { max-width: 1200px; margin: 0 auto; padding: 15px; }
        .consumes-container .consumes-header { text-align: center; margin-bottom: 20px; }
        .consumes-container .consumes-header h1 { color: #e0c89b; font-size: 1.8rem; margin-bottom: 8px; }
        .consumes-container .discount-badge { background: linear-gradient(135deg, #4a9c2d, #2d6b1a); color: white; padding: 8px 20px; border-radius: 20px; font-size: 1.1rem; display: inline-block; }
        .consumes-container .discount-badge.editable { background: linear-gradient(135deg, #8b5a2b, #654321); display: inline-flex; align-items: center; gap: 10px; }
        .consumes-container .discount-input { width: 60px; padding: 4px 8px; border: 1px solid #c8a060; border-radius: 4px; background: rgba(0,0,0,0.3); color: white; font-size: 1rem; text-align: center; }
        .consumes-container .header-actions { margin-top: 10px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
        .consumes-container .download-btn { background: linear-gradient(135deg, #3d7ab8, #2a5580); color: white; padding: 10px 20px; border-radius: 8px; text-decoration: none; font-weight: bold; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s; font-size: 0.9rem; }
        .consumes-container .download-btn:hover { background: linear-gradient(135deg, #4a8fd0, #3d7ab8); transform: translateY(-2px); }
        .consumes-container .scanner-update-banner { background: linear-gradient(135deg, #1a3a2a, #0d2818); border: 1px solid #2d6b45; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; animation: slideDown 0.3s ease-out; }
        @keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
        .consumes-container .scanner-update-content { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
        .consumes-container .scanner-update-icon { font-size: 1.3rem; flex-shrink: 0; }
        .consumes-container .scanner-update-text { flex: 1; min-width: 200px; color: #b8d4c8; font-size: 0.9rem; }
        .consumes-container .scanner-update-text strong { color: #5ddb8a; }
        .consumes-container .scanner-update-changelog { color: #7aaa94; }
        .consumes-container .scanner-update-download { background: #2d6b45; color: #fff; padding: 6px 14px; border-radius: 6px; text-decoration: none; font-weight: bold; font-size: 0.85rem; white-space: nowrap; transition: background 0.2s; }
        .consumes-container .scanner-update-download:hover { background: #3a8a5a; }
        .consumes-container .scanner-update-dismiss { background: none; border: none; color: #5a7a6a; font-size: 1.1rem; cursor: pointer; padding: 4px 8px; line-height: 1; transition: color 0.2s; }
        .consumes-container .scanner-update-dismiss:hover { color: #8ab8a0; }
        @media (max-width: 600px) { .consumes-container .scanner-update-content { gap: 8px; } .consumes-container .scanner-update-text { font-size: 0.82rem; } }
        .consumes-container .cart-btn { background: linear-gradient(135deg, #c9a959, #a08040); color: #1a1a1a; padding: 10px 20px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s; }
        .consumes-container .cart-btn:hover { background: linear-gradient(135deg, #dab96a, #b09050); transform: translateY(-2px); }
        .consumes-container .cart-badge { background: #ff4444; color: white; border-radius: 50%; min-width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: bold; }
        .consumes-container .admin-toggle { background: #2a2a2a; border: 1px solid #4a4a4a; color: #b0a080; padding: 10px 20px; border-radius: 8px; cursor: pointer; transition: all 0.2s; font-size: 0.9rem; }
        .consumes-container .admin-toggle:hover { border-color: #e0c89b; }
        .consumes-container .admin-toggle.active { background: linear-gradient(135deg, #8b5a2b, #654321); border-color: #c8a060; color: #e0c89b; }
        .consumes-container .last-updated-banner { background: #2a2a2a; border: 1px solid #4a4a4a; border-radius: 8px; padding: 10px 20px; margin-top: 15px; display: inline-block; }
        .consumes-container .last-updated-banner .label { color: #808080; font-size: 0.9rem; }
        .consumes-container .last-updated-banner .time { color: #e0c89b; font-weight: bold; margin-left: 8px; }
        .consumes-container .last-updated-banner .relative { color: #c9a959; margin-left: 8px; font-size: 0.9rem; }

        .consumes-container .sticky-toolbar { position: sticky; top: 75px; z-index: 100; background: linear-gradient(180deg, rgba(26,26,26,0.95) 0%, rgba(26,26,26,0.95) 90%, transparent 100%); padding: 12px 0 12px 0; margin: 0 -15px; padding-left: 15px; padding-right: 15px; }
        .consumes-container .sticky-toolbar::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 10px; background: #1a1a1a; z-index: -1; }
        .consumes-container .toolbar-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 12px; }
        .consumes-container .search-container { position: relative; flex: 1; min-width: 200px; max-width: 400px; }
        .consumes-container .search-input { width: 100%; padding: 10px 40px 10px 38px; background: #2a2a2a; border: 2px solid #4a4a4a; border-radius: 8px; color: #e0c89b; font-size: 0.95rem; outline: none; transition: border-color 0.2s; box-sizing: border-box; }
        .consumes-container .search-input:focus { border-color: #c9a959; }
        .consumes-container .search-input::placeholder { color: #666; }
        .consumes-container .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #666; pointer-events: none; font-size: 1rem; }
        .consumes-container .search-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #666; cursor: pointer; font-size: 1.1rem; padding: 2px 6px; }
        .consumes-container .search-clear:hover { color: #e0c89b; }
        .consumes-container .search-results { position: absolute; top: 100%; left: 0; right: 0; background: #1a1a1a; border: 2px solid #c9a959; border-top: none; border-radius: 0 0 8px 8px; max-height: 350px; overflow-y: auto; z-index: 1000; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
        .consumes-container .search-results-header { padding: 8px 12px; font-size: 0.75rem; color: #808080; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #3a3a3a; }
        .consumes-container .search-result-item { padding: 10px 12px; cursor: pointer; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #3a3a3a; transition: background 0.2s; }
        .consumes-container .search-result-item:hover { background: #2a2a2a; }
        .consumes-container .search-result-item:last-child { border-bottom: none; }
        .consumes-container .search-result-icon { width: 32px; height: 32px; border-radius: 4px; border: 1px solid #4a4a4a; flex-shrink: 0; }
        .consumes-container .search-result-icon-placeholder { width: 32px; height: 32px; border-radius: 4px; border: 1px solid #4a4a4a; background: #2a2a2a; display: flex; align-items: center; justify-content: center; color: #666; font-size: 0.8rem; flex-shrink: 0; }
        .consumes-container .search-result-info { flex: 1; min-width: 0; }
        .consumes-container .search-result-name { color: #e0c89b; font-weight: bold; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .consumes-container .search-result-desc { color: #4ade80; font-size: 0.75rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .consumes-container .search-result-price { color: #4a9c2d; font-weight: bold; font-size: 0.85rem; white-space: nowrap; margin-right: 8px; }
        .consumes-container .search-result-add { padding: 5px 10px; background: linear-gradient(135deg, #4a9c2d, #2d6b1a); border: none; border-radius: 5px; color: white; font-size: 0.75rem; font-weight: bold; cursor: pointer; white-space: nowrap; transition: all 0.2s; }
        .consumes-container .search-result-add:hover { background: linear-gradient(135deg, #5ab33d, #3d7b2a); transform: scale(1.05); }
        .consumes-container .search-result-add:disabled { background: #4a4a4a; cursor: not-allowed; transform: none; }
        .consumes-container .search-result-add.added { background: linear-gradient(135deg, #2d6b1a, #1a4a10); }
        .consumes-container .search-result-no-price { color: #666; font-size: 0.8rem; font-style: italic; }

        .consumes-container .price-source { font-size: 0.65rem; padding: 2px 5px; border-radius: 3px; margin-left: 5px; font-weight: bold; }
        .consumes-container .price-source.addon { background: #2d5a27; color: #7fff7f; }
        .consumes-container .price-source.web { background: #5a4a27; color: #ffd700; }
        .consumes-container .price-source.static { background: #4a2d5a; color: #da70d6; }
        .consumes-container .price-legend { display: flex; gap: 15px; justify-content: center; margin-bottom: 15px; font-size: 0.8rem; flex-wrap: wrap; }
        .consumes-container .price-legend-item { display: flex; align-items: center; gap: 5px; }
        .consumes-container .price-legend-dot { width: 10px; height: 10px; border-radius: 50%; }
        .consumes-container .price-legend-dot.addon { background: #7fff7f; }
        .consumes-container .price-legend-dot.web { background: #ffd700; }
        .consumes-container .price-legend-dot.static { background: #da70d6; }
        .consumes-container .category-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; justify-content: center; }
        .consumes-container .category-tab { padding: 6px 14px; background: #2a2a2a; border: 2px solid #4a4a4a; border-radius: 6px; color: #b0a080; cursor: pointer; transition: all 0.2s; font-size: 0.85rem; }
        .consumes-container .category-tab:hover { border-color: #c9a959; }
        .consumes-container .category-tab.active { background: linear-gradient(135deg, #3d3d3d, #2a2a2a); border-color: #c9a959; color: #e0c89b; }
        .consumes-container .items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; max-width: 1200px; }
        @media (min-width: 1200px) { .consumes-container .items-grid { grid-template-columns: repeat(4, 1fr); } }
        .consumes-container .item-card { background: #2a2a2a; border: 1px solid #4a4a4a; border-radius: 8px; padding: 10px; transition: all 0.2s; }
        .consumes-container .item-card:hover { border-color: #c9a959; transform: translateY(-2px); }
        .consumes-container .item-card.in-cart { border-color: #4a9c2d; box-shadow: 0 0 10px rgba(74, 156, 45, 0.3); }
        .consumes-container .item-card.highlight { animation: highlightPulse 1.5s ease-out; }
        @keyframes highlightPulse { 0% { box-shadow: 0 0 0 0 rgba(201, 169, 89, 0.7); border-color: #c9a959; } 70% { box-shadow: 0 0 0 15px rgba(201, 169, 89, 0); } 100% { box-shadow: 0 0 0 0 rgba(201, 169, 89, 0); } }
        .consumes-container .item-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
        .consumes-container .item-icon { width: 40px; height: 40px; border-radius: 4px; border: 2px solid #4a4a4a; background: #1a1a1a; flex-shrink: 0; image-rendering: pixelated; }
        .consumes-container .item-icon-placeholder { width: 40px; height: 40px; border-radius: 4px; border: 2px solid #4a4a4a; background: linear-gradient(135deg, #3a3a3a, #2a2a2a); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #666; font-size: 1rem; }
        .consumes-container a.item-name { color: #e0c89b; font-weight: bold; font-size: 1rem; line-height: 1.3; text-decoration: none; transition: color 0.2s; }
        .consumes-container a.item-name:hover { color: #ffd700; text-decoration: underline; }
        .consumes-container .item-description { color: #4ade80; font-size: 0.8rem; line-height: 1.3; margin: 6px 0 10px 0; }
        .item-reagents { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px 0; }
        .reagent-pill { display: inline-block; font-size: 0.7rem; padding: 1px 6px; border-radius: 8px; background: rgba(255,255,255,0.06); color: #999; border: 1px solid #3a3a3a; line-height: 1.4; }
        .reagent-pill-herb { color: #58d68d; border-color: rgba(88,214,141,0.25); }
        .reagent-pill-vendor { color: #b0b0b0; border-color: rgba(176,176,176,0.2); }
        .reagent-pill-drop { color: #e74c3c; border-color: rgba(231,76,60,0.25); }
        .reagent-pill-crafted { color: #f39c12; border-color: rgba(243,156,18,0.25); }
        .reagent-pill-other { color: #999; border-color: rgba(153,153,153,0.2); }
        /* Stock badges — Phase 3 */
        .consumes-container .stock-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; margin: 4px 0; position: relative; cursor: default; }
        .consumes-container .stock-badge .stock-count { font-size: 0.8rem; font-weight: 800; }
        .consumes-container .stock-badge-surplus { background: rgba(34, 197, 94, 0.2); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.3); }
        .consumes-container .stock-badge-in-stock { background: rgba(20, 184, 166, 0.2); color: #14b8a6; border: 1px solid rgba(20, 184, 166, 0.3); }
        .consumes-container .stock-badge-low-stock { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
        .consumes-container .stock-badge-critical { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
        .consumes-container .stock-badge-out-of-stock { background: rgba(185, 28, 28, 0.2); color: #dc2626; border: 1px solid rgba(185, 28, 28, 0.3); }
        .consumes-container .stock-tooltip { display: none; position: absolute; top: 100%; left: 0; z-index: 100; background: #1a1a1a; border: 1px solid #4a4a4a; border-radius: 6px; padding: 8px 10px; min-width: 200px; margin-top: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); font-weight: normal; letter-spacing: normal; }
        .consumes-container .stock-badge:hover .stock-tooltip { display: block; }
        .consumes-container .stock-tooltip-title { color: #c9a959; font-size: 0.75rem; font-weight: bold; margin-bottom: 4px; border-bottom: 1px solid #333; padding-bottom: 3px; }
        .consumes-container .stock-tooltip-row { display: flex; justify-content: space-between; gap: 12px; padding: 1px 0; font-size: 0.75rem; }
        .consumes-container .stock-tooltip-loc { color: #b0a080; }
        .consumes-container .stock-tooltip-count { color: #e0c89b; font-weight: bold; }
        .consumes-container .stock-tooltip-updated { color: #666; font-size: 0.65rem; margin-top: 4px; border-top: 1px solid #333; padding-top: 3px; }
        .consumes-container .item-card.out-of-stock-card { opacity: 0.7; }
        .consumes-container .item-card.out-of-stock-card:hover { opacity: 1; }
        .consumes-container .stock-price-tier, .herbs-container .stock-price-tier { font-size: 0.65rem; color: #b0a080; margin-left: 6px; font-weight: normal; }
        .herbs-container .shop-price.price-tier-high { color: #22c55e; font-size: 1.3rem; }
        .herbs-container .shop-price.price-tier-good { color: #4ade80; }
        .herbs-container .shop-price.price-tier-low { color: #887750; opacity: 0.75; }

        /* Card border tints by stock level */
        .herbs-container .item-card.stock-need { border-color: #22c55e; border-width: 2px; }
        .herbs-container .item-card.stock-low { border-color: #fbbf24; }
        .herbs-container .item-card.stock-surplus { border-color: #3a3a3a; }

        /* "Pays X% of AH" line on cards */
        .herbs-container .pays-percent { font-size: 0.7rem; color: #9ca3af; margin-top: 2px; }
        .herbs-container .item-card.stock-need .pays-percent { color: #4ade80; font-weight: 600; }
        .herbs-container .item-card.stock-low .pays-percent { color: #fbbf24; }

        /* Stock info line on cards (bank count + supply days) */
        .herbs-container .herb-stock-info { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-size: 0.7rem; color: #6b7280; }
        .herbs-container .herb-bank-count { color: #9ca3af; }
        .herbs-container .herb-supply-days { color: #9ca3af; }
        .herbs-container .herb-supply-days.supply-critical { color: #f87171; font-weight: 600; }
        .herbs-container .herb-supply-days.supply-low { color: #fbbf24; }

        /* Materials admin controls (fixed price per-card) */
        .herbs-container .admin-controls { background: rgba(74, 222, 128, 0.1); border: 1px solid rgba(74, 222, 128, 0.3); border-radius: 6px; padding: 10px; margin-top: 10px; }
        .herbs-container .admin-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
        .herbs-container .admin-row:last-child { margin-bottom: 0; }
        .herbs-container .admin-row label { color: #9ca3af; font-size: 0.85rem; min-width: 50px; }
        .herbs-container .admin-price-input { flex: 1; padding: 6px 10px; border: 1px solid #4a4a4a; border-radius: 4px; background: #1a1a1a; color: #4ade80; font-size: 0.9rem; max-width: 120px; }
        .herbs-container .fixed-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; }
        .herbs-container .fixed-toggle input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: #4ade80; flex-shrink: 0; }
        .herbs-container .fixed-toggle span { color: #9ca3af; font-size: 0.85rem; }
        .herbs-container .price-source { font-size: 0.65rem; padding: 2px 5px; border-radius: 3px; margin-left: 5px; font-weight: bold; vertical-align: middle; }
        .herbs-container .price-source.static { background: #1a3a1a; color: #4ade80; }
        .herbs-container .price-source.linked { background: #1a2a3a; color: #60a5fa; }
        .herbs-container .vendor-note { font-size: 0.72rem; color: #a8926e; font-style: italic; margin-top: 3px; }

        /* Pricing legend box */
        .pricing-legend { background: #1e1e1e; border: 1px solid #3a3a3a; border-radius: 8px; padding: 14px 18px; margin-bottom: 16px; }
        .pricing-legend-title { font-size: 1rem; font-weight: 700; color: #e0c89b; margin-bottom: 6px; }
        .pricing-legend-desc { font-size: 0.8rem; color: #9ca3af; margin-bottom: 10px; line-height: 1.4; }
        .pricing-legend-desc strong { color: #fbbf24; }
        .pricing-legend-tiers { display: flex; flex-wrap: wrap; gap: 6px 16px; }
        .pricing-legend-tier { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; padding: 4px 0; min-width: 200px; }
        .pricing-legend-tier .tier-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
        .pricing-legend-tier .tier-dot.need { background: #22c55e; }
        .pricing-legend-tier .tier-dot.critical { background: #4ade80; }
        .pricing-legend-tier .tier-dot.low { background: #fbbf24; }
        .pricing-legend-tier .tier-dot.stocked { background: #60a5fa; }
        .pricing-legend-tier .tier-dot.surplus { background: #6b7280; }
        .pricing-legend-tier .tier-name { color: #d4d4d4; flex: 1; }
        .pricing-legend-tier .tier-range { color: #6b7280; font-size: 0.7rem; }
        .pricing-legend-tier .tier-rate { color: #fbbf24; font-weight: 700; white-space: nowrap; }
        .consumes-container .stock-summary-bar { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; font-size: 0.75rem; }
        .consumes-container .stock-summary-item { display: flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 4px; background: rgba(255,255,255,0.05); }
        .consumes-container .stock-summary-dot { width: 8px; height: 8px; border-radius: 50%; }
        .consumes-container .stock-summary-dot.surplus { background: #22c55e; }
        .consumes-container .stock-summary-dot.in-stock { background: #14b8a6; }
        .consumes-container .stock-summary-dot.low-stock { background: #fbbf24; }
        .consumes-container .stock-summary-dot.critical { background: #f87171; }
        .consumes-container .stock-summary-dot.out-of-stock { background: #dc2626; }
        .consumes-container .stock-refresh-btn { padding: 5px 14px; border-radius: 6px; border: 1px solid #4ade80; background: rgba(74,222,128,0.15); color: #4ade80; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.2s; margin-left: 12px; letter-spacing: 0.3px; }
        .consumes-container .stock-refresh-btn:hover { background: rgba(74,222,128,0.3); color: #fff; border-color: #4ade80; }
        .consumes-container .stock-refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; border-color: #fbbf24; color: #fbbf24; background: rgba(251,191,36,0.15); }

        .consumes-container .item-prices { margin: 8px 0; }
        .consumes-container .shop-price { font-size: 1.2rem; color: #4a9c2d; font-weight: bold; }
        .consumes-container .ah-price { color: #808080; font-size: 0.85rem; margin-left: 8px; }
        .consumes-container .fixed-badge { background: #c9a959; color: #1a1a1a; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; margin-left: 8px; }
        .consumes-container .no-price { color: #808080; font-style: italic; }
        .consumes-container .add-to-cart-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
        .consumes-container .qty-control { display: flex; align-items: center; background: #3a3a3a; border-radius: 6px; overflow: visible; flex-shrink: 0; min-width: 110px; }
        .consumes-container .qty-btn { width: 28px; height: 28px; border: none; background: transparent; color: #e0c89b; font-size: 1.1rem; cursor: pointer; transition: background 0.2s; }
        .consumes-container .qty-btn:hover { background: rgba(255,255,255,0.1); }
        .consumes-container .qty-input { width: 50px; text-align: center; border: none; background: transparent; color: #e0c89b; font-size: 0.95rem; -moz-appearance: textfield; appearance: textfield; padding: 4px 2px; }
        .consumes-container .qty-input::-webkit-inner-spin-button, .consumes-container .qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
        .consumes-container .add-btn { flex: 1; padding: 6px 10px; background: linear-gradient(135deg, #4a9c2d, #2d6b1a); border: none; border-radius: 6px; color: white; font-weight: bold; cursor: pointer; transition: all 0.2s; font-size: 0.9rem; }
        .consumes-container .add-btn:hover { background: linear-gradient(135deg, #5ab33d, #3d7b2a); }
        .consumes-container .add-btn:disabled { background: #4a4a4a; cursor: not-allowed; }
        .consumes-container .remove-btn { flex: 1; padding: 6px 10px; background: transparent; border: 1px solid #ef4444; border-radius: 6px; color: #ef4444; font-weight: bold; cursor: pointer; transition: all 0.2s; font-size: 0.9rem; }
        .consumes-container .remove-btn:hover { background: rgba(239, 68, 68, 0.2); }
        .consumes-container .in-cart-indicator { color: #4a9c2d; font-size: 0.8rem; margin-top: 6px; }
        .consumes-container .cart-overlay { position: fixed; top: 95px; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.8); z-index: 1100; display: flex; justify-content: flex-end; }
        .consumes-container .cart-panel { width: 340px; max-width: 100%; background: #1a1a1a; height: 100%; display: flex; flex-direction: column; border-left: 2px solid #c9a959; }
        .consumes-container .cart-header { padding: 12px 15px; border-bottom: 1px solid #4a4a4a; display: flex; justify-content: space-between; align-items: center; }
        .consumes-container .cart-header h2 { color: #e0c89b; margin: 0; font-size: 1.1rem; }
        .consumes-container .close-btn { background: none; border: none; color: #b0a080; font-size: 1.5rem; cursor: pointer; }
        .consumes-container .cart-items { flex: 1; overflow-y: auto; padding: 10px; }
        .consumes-container .cart-item { background: #2a2a2a; border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; }
        .consumes-container .cart-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
        .consumes-container .cart-item-name { color: #e0c89b; font-weight: bold; }
        .consumes-container .cart-item-remove { background: none; border: none; color: #ff6b6b; cursor: pointer; font-size: 1rem; }
        .consumes-container .cart-item-details { display: flex; justify-content: space-between; align-items: center; }
        .consumes-container .cart-item-price { color: #4a9c2d; font-weight: bold; }
        .consumes-container .cart-item-qty { display: flex; align-items: center; gap: 8px; }
        .consumes-container .cart-item-qty input { width: 50px; padding: 4px; text-align: center; background: #3a3a3a; border: 1px solid #4a4a4a; border-radius: 4px; color: #e0c89b; }
        .consumes-container .cart-empty { text-align: center; color: #808080; padding: 40px 20px; }
        .consumes-container .cart-footer { padding: 12px 15px; border-top: 1px solid #4a4a4a; }
        .consumes-container .cart-notes { margin-bottom: 10px; }
        .consumes-container .cart-notes label { display: block; color: #b0a080; margin-bottom: 3px; font-size: 0.8rem; }
        .consumes-container .cart-notes textarea { width: 100%; padding: 8px; background: #2a2a2a; border: 1px solid #4a4a4a; border-radius: 5px; color: #e0c89b; resize: vertical; min-height: 50px; box-sizing: border-box; font-size: 0.85rem; }
        .consumes-container .cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 1rem; }
        .consumes-container .cart-total-label { color: #b0a080; font-size: 0.9rem; }
        .consumes-container .cart-total-value { color: #4a9c2d; font-weight: bold; font-size: 1.1rem; }
        .consumes-container .checkout-btn { width: 100%; padding: 10px; background: linear-gradient(135deg, #4a9c2d, #2d6b1a); border: none; border-radius: 6px; color: white; font-size: 0.95rem; font-weight: bold; cursor: pointer; transition: all 0.2s; }
        .consumes-container .checkout-btn:hover { background: linear-gradient(135deg, #5ab33d, #3d7b2a); }
        .consumes-container .checkout-btn:disabled { background: #4a4a4a; cursor: not-allowed; }
        .consumes-container .clear-cart-btn { width: 100%; padding: 8px; background: transparent; border: 1px solid #4a4a4a; border-radius: 5px; color: #b0a080; margin-top: 8px; cursor: pointer; font-size: 0.85rem; }
        .consumes-container .clear-cart-btn:hover { border-color: #ff6b6b; color: #ff6b6b; }
        .consumes-container .status-message { text-align: center; padding: 15px; border-radius: 8px; margin-bottom: 20px; }
        .consumes-container .status-success { background: rgba(74, 156, 45, 0.2); color: #4a9c2d; border: 1px solid #4a9c2d; }
        .consumes-container .status-error { background: rgba(200, 50, 50, 0.2); color: #c83232; border: 1px solid #c83232; }
        .consumes-container .admin-bar { background: linear-gradient(135deg, #8b5a2b, #654321); border: 1px solid #c8a060; border-radius: 10px; padding: 15px 20px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
        .consumes-container .admin-bar-title { color: #e0c89b; font-weight: bold; font-size: 1.1rem; }
        .consumes-container .admin-bar-actions { display: flex; gap: 10px; align-items: center; }
        .consumes-container .save-btn { background: linear-gradient(135deg, #4a9c2d, #2d6b1a); color: white; padding: 8px 20px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; }
        .consumes-container .save-btn:disabled { background: #4a4a4a; cursor: not-allowed; }
        .consumes-container .discount-save-btn { padding: 4px 12px; background: #4ade80; color: #111827; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; font-size: 0.85rem; margin-left: 10px; }
        .consumes-container .discount-save-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .consumes-container .discount-save-msg { font-size: 0.85rem; padding: 4px 8px; border-radius: 4px; margin-left: 8px; }
        .consumes-container .discount-save-msg.success { background: rgba(74, 222, 128, 0.3); color: #4ade80; }
        .consumes-container .discount-save-msg.error { background: rgba(239, 68, 68, 0.3); color: #ef4444; }
        .consumes-container .dynamic-toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.9rem; white-space: nowrap; }
        .consumes-container .dynamic-toggle input[type="checkbox"] { accent-color: #4ade80; width: 16px; height: 16px; }
        .consumes-container .tier-discount-controls { display: flex; flex-wrap: wrap; gap: 6px 12px; }
        .consumes-container .tier-discount-row { display: flex; align-items: center; gap: 4px; font-size: 0.8rem; white-space: nowrap; }
        .consumes-container .tier-label { color: #d4d4d4; min-width: 90px; }
        .consumes-container .tier-discount-input { width: 42px; padding: 2px 4px; border: 1px solid #c8a060; border-radius: 3px; background: rgba(0,0,0,0.3); color: white; font-size: 0.85rem; text-align: center; }
        .consumes-container .tier-pct { color: #a0a0a0; }
        .consumes-container .flat-discount-control { display: flex; align-items: center; gap: 6px; }
        .consumes-container .discount-badge.editable { background: linear-gradient(135deg, #8b5a2b, #654321); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; }
        .consumes-container .save-message { padding: 6px 12px; border-radius: 4px; font-size: 0.9rem; }
        .consumes-container .save-message.success { background: rgba(74, 156, 45, 0.3); color: #5ab33d; }
        .consumes-container .save-message.error { background: rgba(200, 50, 50, 0.3); color: #ff6b6b; }
        .consumes-container .admin-controls { background: rgba(139, 90, 43, 0.2); border: 1px solid #8b5a2b; border-radius: 6px; padding: 10px; margin-top: 10px; }
        .consumes-container .admin-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
        .consumes-container .admin-row:last-child { margin-bottom: 0; }
        .consumes-container .admin-row label { color: #b0a080; font-size: 0.85rem; min-width: 70px; }
        .consumes-container .admin-price-input { flex: 1; padding: 6px 10px; border: 1px solid #4a4a4a; border-radius: 4px; background: #1a1a1a; color: #e0c89b; font-size: 0.9rem; }
        .consumes-container .fixed-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; }
        .consumes-container .fixed-toggle input { width: 18px; height: 18px; cursor: pointer; }
        .consumes-container .fixed-toggle span { color: #b0a080; font-size: 0.85rem; }
        .consumes-container .modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.8); display: flex; align-items: center; justify-content: center; z-index: 1000; }
        .consumes-container .modal-content { background: #1a1a1a; border: 2px solid #c9a959; border-radius: 15px; padding: 30px; max-width: 400px; width: 90%; }
        .consumes-container .modal-header { text-align: center; margin-bottom: 20px; }
        .consumes-container .modal-header h2 { color: #e0c89b; margin-bottom: 5px; }
        .consumes-container .modal-body { margin-bottom: 20px; }
        .consumes-container .form-group { margin-bottom: 15px; }
        .consumes-container .form-group label { display: block; color: #b0a080; margin-bottom: 5px; }
        .consumes-container .form-group input { width: 100%; padding: 10px; background: #2a2a2a; border: 1px solid #4a4a4a; border-radius: 6px; color: #e0c89b; box-sizing: border-box; }
        .consumes-container .form-group input.error { border-color: #ff6b6b; }
        .consumes-container .form-group .error-text { color: #ff6b6b; font-size: 0.85rem; margin-top: 5px; }
        .consumes-container .modal-actions { display: flex; gap: 10px; }
        .consumes-container .modal-actions button { flex: 1; padding: 12px; border-radius: 6px; font-weight: bold; cursor: pointer; border: none; }
        .consumes-container .btn-cancel { background: #2a2a2a; color: #b0a080; border: 1px solid #4a4a4a !important; }
        .consumes-container .btn-confirm { background: linear-gradient(135deg, #4a9c2d, #2d6b1a); color: white; }
        .consumes-container .loading, .consumes-container .error { text-align: center; padding: 40px; color: #b0a080; }
        @media (max-width: 768px) { .consumes-container .consumes-header h1 { font-size: 1.8rem; } .consumes-container .category-tabs { flex-direction: column; } .consumes-container .items-grid { grid-template-columns: 1fr; } .consumes-container .cart-panel { width: 100%; } }

        /* Package tab styles */
        .consumes-container .packages-tab { background: linear-gradient(135deg, #2a3a2a, #1a2a1a); border-color: #4a7a4a; color: #7ac87a; }
        .consumes-container .packages-tab:hover { border-color: #5ab85a; }
        .consumes-container .packages-tab.active { background: linear-gradient(135deg, #2d4a2d, #1a3a1a); border-color: #5ab85a; color: #7ee87e; }
        .consumes-container .class-selector { display: flex; gap: 6px; margin-bottom: 16px; justify-content: center; }
        .consumes-container .class-selector.single-class { display: none; }
        .consumes-container .class-tab { padding: 6px 16px; background: #2a2a2a; border: 2px solid #4a4a4a; border-radius: 6px; color: #b0a080; cursor: pointer; transition: all 0.2s; font-size: 0.85rem; }
        .consumes-container .class-tab:hover { border-color: #c9a959; }
        .consumes-container .class-tab.active { background: linear-gradient(135deg, #3d3d3d, #2a2a2a); border-color: #c9a959; color: #e0c89b; }
        .consumes-container .packages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; max-width: 1200px; }
        .consumes-container .package-card { background: #2a2a2a; border: 1px solid #4a4a4a; border-radius: 10px; padding: 16px; transition: all 0.2s; display: flex; flex-direction: column; }
        .consumes-container .package-card:hover { border-color: #c9a959; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
        .consumes-container .package-card-header { margin-bottom: 12px; }
        .consumes-container .package-card-header h3 { color: #e0c89b; font-size: 1.1rem; margin: 0 0 4px 0; }
        .consumes-container .package-card-header p { color: #808080; font-size: 0.8rem; margin: 0; }
        .consumes-container .package-items-list { flex: 1; display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
        .consumes-container .package-item-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 4px; transition: background 0.15s; }
        .consumes-container .package-item-row:hover { background: rgba(255,255,255,0.03); }
        .consumes-container .package-item-icon { width: 24px; height: 24px; border-radius: 3px; border: 1px solid #4a4a4a; flex-shrink: 0; image-rendering: pixelated; }
        .consumes-container .package-item-icon-placeholder { width: 24px; height: 24px; border-radius: 3px; border: 1px solid #4a4a4a; background: #1a1a1a; display: flex; align-items: center; justify-content: center; color: #666; font-size: 0.6rem; flex-shrink: 0; }
        .consumes-container .package-item-qty { color: #c9a959; font-weight: bold; font-size: 0.8rem; min-width: 28px; text-align: right; flex-shrink: 0; }
        .consumes-container .package-item-name { color: #d4d4d4; font-size: 0.8rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .consumes-container .package-item-price { color: #4a9c2d; font-size: 0.75rem; font-weight: bold; text-align: right; min-width: 60px; flex-shrink: 0; }
        .consumes-container .package-item-no-price { color: #666; font-size: 0.75rem; font-style: italic; text-align: right; min-width: 60px; flex-shrink: 0; }
        .consumes-container .package-choice-row { display: flex; align-items: center; gap: 8px; padding: 6px; background: rgba(201, 169, 89, 0.08); border: 1px solid rgba(201, 169, 89, 0.2); border-radius: 6px; margin-top: 2px; }
        .consumes-container .prot-select { flex: 1; padding: 5px 8px; background: #1a1a1a; border: 1px solid #4a4a4a; border-radius: 4px; color: #e0c89b; font-size: 0.8rem; cursor: pointer; outline: none; appearance: auto; }
        .consumes-container .prot-select:focus { border-color: #c9a959; }
        .consumes-container .package-footer { border-top: 1px solid #3a3a3a; padding-top: 12px; }
        .consumes-container .package-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
        .consumes-container .package-total-label { color: #b0a080; font-size: 0.9rem; }
        .consumes-container .package-total-value { color: #4a9c2d; font-weight: bold; font-size: 1.15rem; }
        .consumes-container .package-add-btn { width: 100%; padding: 10px; background: linear-gradient(135deg, #4a9c2d, #2d6b1a); border: none; border-radius: 6px; color: white; font-size: 0.9rem; font-weight: bold; cursor: pointer; transition: all 0.2s; }
        .consumes-container .package-add-btn:hover { background: linear-gradient(135deg, #5ab33d, #3d7b2a); transform: translateY(-1px); }
        .consumes-container .package-add-btn:disabled { background: #4a4a4a; cursor: not-allowed; transform: none; }
        @media (max-width: 820px) { .consumes-container .packages-grid { grid-template-columns: 1fr; } }

/* ==================== ConsumesTabs.tsx extracted styles ==================== */

.consumes-tabs-container {
          max-width: 1200px;
          margin: 0 auto;
          padding: 0 10px;
        }
        .tabs-header {
          display: flex;
          gap: 0;
          margin-bottom: 0;
          padding-left: 10px;
        }
        .tab-button {
          padding: 10px 24px;
          background: rgba(42, 42, 42, 0.9);
          border: 2px solid #4a4a4a;
          border-bottom: 2px solid #4a4a4a;
          border-radius: 8px 8px 0 0;
          color: #808080;
          font-size: 0.95rem;
          font-weight: 600;
          cursor: pointer;
          transition: all 0.2s;
          margin-right: -2px;
          margin-bottom: -2px;
          position: relative;
        }
        .tab-button:hover {
          background: rgba(58, 58, 58, 0.9);
          color: #b0a080;
        }
        .tab-button.active {
          background: transparent;
          border-color: #c9a959;
          border-bottom-color: transparent;
          color: #e0c89b;
          z-index: 2;
        }
        .tab-button.buy-tab.active {
          border-color: #c9a959;
          border-bottom-color: transparent;
          color: #e0c89b;
        }
        .tab-button.sell-tab.active {
          border-color: #4ade80;
          border-bottom-color: transparent;
          color: #4ade80;
        }
        .tab-content {
          background: transparent;
          border: 2px solid #4a4a4a;
          border-radius: 0 8px 8px 8px;
          min-height: 400px;
          position: relative;
        }
        .tab-content.buy-active {
          border-color: #c9a959;
        }
        .tab-content.sell-active {
          border-color: #4ade80;
        }
        .tab-panel {
          display: none;
        }
        .tab-panel.active {
          display: block;
        }

/* ==================== Nav.tsx extracted styles ==================== */

.nav-auth-wrapper {
          position: absolute;
          right: 20px;
          top: 50%;
          transform: translateY(-50%);
          z-index: 101;
        }
        @media (max-width: 768px) {
          .nav-auth-wrapper {
            position: static;
            transform: none;
            margin: 10px 0;
            order: -1;
          }
        }
        .nav-decoration {
          position: absolute;
          bottom: -35px;
          left: 0;
          width: 100%;
          height: 50px;
          background-image: url('/images/nav-decoration.png');
          background-repeat: repeat-x;
          background-size: auto 100%;
          background-position: center top;
          z-index: 100;
          pointer-events: none;
        }

/* ==================== AnalyzeContainer.tsx extracted styles ==================== */

.analyze-grid {
          display: grid;
          grid-template-columns: 35% 65%;
          gap: 1.5rem;
          margin-top: 1.5rem;
        }

        .analyze-section {
          display: flex;
          flex-direction: column;
          gap: 1.5rem;
        }

        .log-selection {
          /* LogSelector on left - narrower */
        }

        .chat-section {
          /* Chat only */
          display: flex;
          flex-direction: column;
        }

        @media (max-width: 1024px) {
          .analyze-grid {
            grid-template-columns: 1fr;
          }
        }

/* ==================== LogProcessor.tsx extracted styles ==================== */

input[type="time"]::-webkit-calendar-picker-indicator,
        input[type="date"]::-webkit-calendar-picker-indicator {
          filter: brightness(0) invert(1);
          cursor: pointer;
          opacity: 1;
        }
        input[type="time"],
        input[type="date"] {
          color-scheme: dark;
        }
        select {
          color-scheme: dark;
        }
        select option {
          background: #1c1c1e;
          color: #ffffff;
        }

/* ==================== ReportPreview.tsx extracted styles ==================== */

        .report-preview .modal-overlay {
          position: fixed;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          background: rgba(0, 0, 0, 0.85);
          display: flex;
          align-items: center;
          justify-content: center;
          z-index: 1000;
          padding: 2rem;
        }

        .report-preview .modal-content {
          background: #1a1a1a;
          border: 2px solid var(--border);
          border-radius: 12px;
          max-width: 900px;
          width: 100%;
          max-height: 90vh;
          display: flex;
          flex-direction: column;
          box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        }

        .report-preview .modal-header {
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding: 1.5rem;
          border-bottom: 1px solid var(--border);
        }

        .report-preview .modal-header h2 {
          margin: 0;
          color: var(--text-primary);
        }

        .report-preview .close-btn {
          background: none;
          border: none;
          font-size: 1.5rem;
          color: var(--text-secondary);
          cursor: pointer;
          padding: 0.25rem 0.5rem;
          line-height: 1;
          transition: color 0.2s;
        }

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

        .report-preview .modal-body {
          flex: 1;
          overflow-y: auto;
          padding: 2rem;
        }

        .report-preview .report-preview-content {
          color: var(--text-primary);
          line-height: 1.6;
        }

        /* Styling to match existing raid reports */
        .report-preview .report-preview-content h1 {
          font-size: 1.75rem;
          color: var(--text-primary);
          margin: 0 0 1rem 0;
        }

        .report-preview .report-preview-content h2 {
          font-size: 1.4rem;
          color: var(--text-primary);
          margin: 2rem 0 1rem 0;
          border-bottom: 2px solid var(--border);
          padding-bottom: 0.5rem;
        }

        .report-preview .report-preview-content h3 {
          font-size: 1.1rem;
          color: var(--apple-blue);
          margin: 1.5rem 0 0.75rem 0;
        }

        .report-preview .report-preview-content p {
          margin: 0.75rem 0;
          color: var(--text-secondary);
        }

        .report-preview .report-preview-content ul {
          margin: 0.75rem 0;
          padding-left: 1.5rem;
        }

        .report-preview .report-preview-content li {
          margin: 0.5rem 0;
          color: var(--text-secondary);
        }

        .report-preview .report-preview-content table.raid-table {
          width: 100%;
          border-collapse: collapse;
          margin: 1rem 0;
          background: var(--bg-secondary);
          border-radius: 6px;
          overflow: hidden;
        }

        .report-preview .report-preview-content table.raid-table tr {
          border-bottom: 1px solid var(--border);
        }

        .report-preview .report-preview-content table.raid-table tr:last-child {
          border-bottom: none;
        }

        .report-preview .report-preview-content table.raid-table td {
          padding: 0.75rem 1rem;
          color: var(--text-primary);
        }

        .report-preview .report-preview-content table.raid-table tr:first-child td {
          font-weight: 700;
          background: var(--bg-tertiary);
        }

        .report-preview .report-preview-content strong {
          color: var(--text-primary);
          font-weight: 700;
        }

        .report-preview .report-preview-content em {
          color: var(--text-secondary);
          font-style: italic;
        }

        .report-preview .modal-footer {
          display: flex;
          justify-content: space-between;
          padding: 1.5rem;
          border-top: 1px solid var(--border);
          gap: 1rem;
        }

        .keep-working-btn,
        .report-preview .approve-btn {
          padding: 0.75rem 1.5rem;
          border: none;
          border-radius: 6px;
          font-weight: 600;
          cursor: pointer;
          transition: opacity 0.2s;
          font-size: 0.95rem;
        }

        .report-preview .keep-working-btn {
          background: var(--bg-tertiary);
          color: var(--text-primary);
          border: 1px solid var(--border);
        }

        .report-preview .approve-btn {
          background: var(--apple-green);
          color: white;
        }

        .keep-working-btn:hover,
        .report-preview .approve-btn:hover {
          opacity: 0.8;
        }

        @media (max-width: 768px) {
        .report-preview .modal-overlay {
            padding: 1rem;
          }

        .report-preview .modal-content {
            max-height: 95vh;
          }

        .report-preview .modal-footer {
            flex-direction: column;
          }

          .keep-working-btn,
        .report-preview .approve-btn {
            width: 100%;
          }
        }

/* ==================== LogSelector.tsx extracted styles ==================== */

        .log-selector {
          background: var(--bg-secondary);
          border: 2px solid var(--border);
          border-radius: 8px;
          padding: 1.5rem;
          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }

        .log-selector-header {
          margin-bottom: 1.5rem;
        }

        .log-selector-header h3 {
          margin: 0 0 0.5rem 0;
          color: var(--text-primary);
        }

        .log-selector .subtitle {
          color: var(--text-secondary);
          font-size: 0.9rem;
          margin: 0;
        }

        .clear-selection-btn {
          margin-left: 1rem;
          padding: 0.25rem 0.75rem;
          background: var(--apple-red);
          color: white;
          border: none;
          border-radius: 4px;
          font-size: 0.85rem;
          cursor: pointer;
          transition: opacity 0.2s;
        }

        .clear-selection-btn:hover {
          opacity: 0.8;
        }

        .log-filters {
          display: grid;
          grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
          gap: 1rem;
          margin-bottom: 1.5rem;
        }

        .filter-group {
          display: flex;
          flex-direction: column;
          gap: 0.5rem;
        }

        .filter-group label {
          font-size: 0.85rem;
          font-weight: 600;
          color: var(--text-secondary);
          text-transform: uppercase;
          letter-spacing: 0.5px;
        }

        .filter-select,
        .filter-input {
          padding: 0.5rem;
          background: rgb(30, 30, 34);
          border: 1px solid var(--border);
          border-radius: 4px;
          color: #ffffff;
          font-size: 0.9rem;
          -webkit-appearance: none;
          -moz-appearance: none;
          appearance: none;
        }

        .filter-select {
          background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
          background-repeat: no-repeat;
          background-position: right 0.5rem center;
          padding-right: 2rem;
          cursor: pointer;
        }

        .filter-select option {
          background: rgb(30, 30, 34);
          color: #ffffff;
          padding: 8px;
        }

        .filter-select:focus,
        .filter-input:focus {
          outline: none;
          border-color: var(--apple-blue);
        }

        .loading-state,
        .error-state,
        .log-selector .empty-state {
          text-align: center;
          padding: 2rem;
          color: var(--text-secondary);
        }

        .retry-btn {
          margin-top: 1rem;
          padding: 0.5rem 1rem;
          background: var(--apple-blue);
          color: white;
          border: none;
          border-radius: 4px;
          cursor: pointer;
        }

        .logs-list {
          display: flex;
          flex-direction: column;
          gap: 0.75rem;
          max-height: 400px;
          overflow-y: auto;
          margin-bottom: 1rem;
        }

        .log-item {
          display: flex;
          gap: 0.75rem;
          padding: 0.75rem;
          background: var(--bg-tertiary);
          border: 2px solid var(--border);
          border-radius: 6px;
          cursor: pointer;
          transition: all 0.2s;
        }

        .log-item:hover {
          border-color: var(--apple-blue);
          background: var(--bg-secondary);
        }

        .log-item.selected {
          border-color: var(--apple-blue);
          background: rgba(59, 130, 246, 0.1);
        }

        .log-checkbox input {
          cursor: pointer;
          width: 18px;
          height: 18px;
        }

        .log-details {
          flex: 1;
        }

        .log-display-name {
          font-weight: 600;
          color: var(--text-primary);
          margin-bottom: 0.5rem;
        }

        .log-metadata {
          display: flex;
          gap: 1rem;
          flex-wrap: wrap;
        }

        .meta-item {
          font-size: 0.8rem;
          color: var(--text-secondary);
        }

        .load-more-btn {
          width: 100%;
          padding: 0.75rem;
          background: var(--bg-tertiary);
          border: 1px solid var(--border);
          border-radius: 4px;
          color: var(--text-primary);
          cursor: pointer;
          transition: all 0.2s;
        }

        .load-more-btn:hover {
          background: var(--bg-secondary);
          border-color: var(--apple-blue);
        }

/* ==================== UserAuthButton.tsx extracted styles ==================== */

.user-auth-container {
          position: relative;
          margin-left: auto;
        }
        .auth-btn {
          display: flex;
          align-items: center;
          gap: 8px;
          padding: 8px 16px;
          border-radius: 6px;
          font-weight: 600;
          font-size: 0.9rem;
          cursor: pointer;
          transition: all 0.2s;
          border: none;
          text-decoration: none;
        }
        .login-btn {
          background: #5865F2;
          color: white;
        }
        .login-btn:hover {
          background: #4752C4;
        }
        .user-btn {
          background: rgba(74, 222, 128, 0.2);
          border: 1px solid #4ade80;
          color: #4ade80;
        }
        .user-btn:hover {
          background: rgba(74, 222, 128, 0.3);
        }
        .loading-btn {
          background: #3a3a3a;
          color: #666;
          cursor: default;
        }
        .discord-icon {
          width: 18px;
          height: 18px;
        }
        .user-dropdown {
          position: absolute;
          top: 100%;
          right: 0;
          margin-top: 8px;
          background: #1a1a1a;
          border: 1px solid #4a4a4a;
          border-radius: 8px;
          min-width: 180px;
          box-shadow: 0 8px 24px rgba(0,0,0,0.5);
          z-index: 1000;
          overflow: hidden;
        }
        .user-dropdown-header {
          padding: 12px 16px;
          border-bottom: 1px solid #3a3a3a;
          color: #4ade80;
          font-weight: 600;
          font-size: 0.9rem;
        }
        .user-dropdown-sub {
          color: #666;
          font-size: 0.75rem;
          font-weight: normal;
          margin-top: 2px;
        }
        .logout-btn {
          width: 100%;
          padding: 12px 16px;
          background: none;
          border: none;
          color: #ef4444;
          font-size: 0.9rem;
          cursor: pointer;
          text-align: left;
          transition: background 0.2s;
        }
        .logout-btn:hover {
          background: rgba(239, 68, 68, 0.2);
        }

/* ==================== RaidRefreshIndicator.tsx extracted styles ==================== */

        .raid-refresh-indicator {
          display: inline-flex;
          align-items: center;
          gap: 8px;
          padding: 6px 12px;
          background: rgba(88, 86, 214, 0.15);
          border: 1px solid rgba(88, 86, 214, 0.3);
          border-radius: 20px;
          font-size: 13px;
          transition: all 0.3s ease;
        }

        .raid-refresh-indicator.stale {
          background: rgba(245, 158, 11, 0.15);
          border-color: rgba(245, 158, 11, 0.5);
          animation: stale-pulse 2s ease-in-out infinite;
        }

        @keyframes stale-pulse {
          0%, 100% { border-color: rgba(245, 158, 11, 0.5); }
          50% { border-color: rgba(245, 158, 11, 0.8); }
        }

        .refresh-time {
          color: var(--text-secondary, #8e8e93);
        }

        .raid-refresh-indicator .stale .refresh-time {
          color: #f59e0b;
        }

        .raid-refresh-indicator .refresh-btn {
          background: none;
          border: none;
          cursor: pointer;
          font-size: 16px;
          padding: 2px 6px;
          border-radius: 6px;
          transition: all 0.2s ease;
          display: flex;
          align-items: center;
          justify-content: center;
        }

        .raid-refresh-indicator .refresh-btn:hover:not(:disabled) {
          background: rgba(88, 86, 214, 0.3);
          transform: scale(1.1);
        }

        .raid-refresh-indicator .refresh-btn:disabled {
          opacity: 0.5;
          cursor: not-allowed;
        }

        .refresh-spinner {
          display: inline-block;
          animation: spin 1s linear infinite;
        }

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

        @media (max-width: 600px) {
        .raid-refresh-indicator {
            padding: 4px 10px;
            font-size: 12px;
          }
        .raid-refresh-indicator .refresh-btn {
            font-size: 14px;
          }
        }

/* ==================== CostMonitor.tsx extracted styles ==================== */

.cost-monitor {
          display: flex;
          align-items: center;
          gap: 0.75rem;
          background: var(--bg-secondary);
          border: 1px solid var(--border);
          border-radius: 6px;
          padding: 0.5rem 1rem;
          font-size: 0.85rem;
          white-space: nowrap;
        }

        .cost-monitor.warning {
          border-color: var(--apple-orange);
          background: rgba(255, 159, 10, 0.05);
        }

        .cost-monitor.critical {
          border-color: var(--apple-red);
          background: rgba(255, 69, 58, 0.05);
        }

        .cost-monitor.exceeded {
          border-color: var(--apple-red);
          background: rgba(255, 69, 58, 0.1);
        }

        .cost-inline {
          color: var(--text-secondary);
          font-size: 0.85rem;
        }

        .cost-inline strong {
          color: var(--text-primary);
          font-weight: 600;
        }

        .separator {
          color: var(--border);
          font-weight: 300;
        }

        .warning-inline {
          color: var(--apple-orange);
          font-size: 0.85rem;
          font-weight: 600;
        }

        .cost-monitor.critical .warning-inline,
        .cost-monitor.exceeded .warning-inline {
          color: var(--apple-red);
        }

        .cost-monitor.loading {
          padding: 1rem;
          text-align: center;
          color: var(--text-secondary);
          font-size: 0.8rem;
        }

/* ==================== RaidRoster.tsx extracted styles ==================== */

/* Status Pills */
        .roster-status-pills {
          display: flex;
          justify-content: center;
          gap: 8px;
          margin-bottom: 16px;
          flex-wrap: wrap;
        }

        .class-groups {
          display: grid;
          grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
          gap: 12px;
        }

        .class-group {
          background: var(--background-tertiary);
          border-radius: 6px;
          overflow: hidden;
        }

        .class-group-header {
          display: flex;
          align-items: center;
          gap: 6px;
          padding: 8px 12px;
          background: var(--background-secondary);
          border-left: 3px solid;
        }

        .class-group-icon {
          font-size: 16px;
        }

        .class-group-name {
          font-size: 12px;
          letter-spacing: 0.5px;
          flex: 1;
          font-weight: 600;
        }

        .class-group-count {
          color: var(--text-tertiary);
          font-size: 11px;
          font-weight: 500;
        }

        @media (max-width: 768px) {
          .class-groups {
            grid-template-columns: 1fr;
          }
        }

/* ==================== RaidResFetcher.tsx extracted styles ==================== */

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

        /* WoW-style tooltip content */
        .tw-tooltip-content {
          font-size: 13px;
          line-height: 1.4;
          color: #ffd100;
        }
        .tw-tooltip-content b {
          color: #ffd100;
        }
        .tw-tooltip-content .q0 { color: #9d9d9d; }
        .tw-tooltip-content .q1 { color: #ffffff; }
        .tw-tooltip-content .q2 { color: #1eff00; }
        .tw-tooltip-content .q3 { color: #0070dd; }
        .tw-tooltip-content .q4 { color: #a335ee; }
        .tw-tooltip-content .q5 { color: #ff8000; }
        .tw-tooltip-content table {
          width: 100%;
        }
        .tw-tooltip-content td, .tw-tooltip-content th {
          color: #fff;
          font-size: 12px;
          padding: 1px 0;
        }
        .tw-tooltip-content a {
          color: #1eff00;
          text-decoration: none;
        }
        .tw-tooltip-content br {
          display: block;
          margin: 2px 0;
        }

/* ==================== PlayerStatsTable.tsx extracted styles ==================== */

.hoverable-stat {
          cursor: help;
          border-bottom: 1px dotted var(--text-tertiary);
          transition: all 0.2s ease;
          position: relative;
        }
        .hoverable-stat:hover {
          opacity: 0.9;
          border-bottom: 2px solid currentColor;
        }
        .hoverable-stat::after {
          content: "ⓘ";
          font-size: 9px;
          opacity: 0.5;
          margin-left: 2px;
          vertical-align: super;
          color: var(--text-tertiary);
        }
        .hoverable-stat:hover::after {
          opacity: 1;
          color: var(--apple-blue);
        }

/* ==================== LootAnalytics.tsx extracted styles ==================== */

canvas {
          max-width: 100%;
        }

/* ==================== RecipeBrowser.tsx extracted styles ==================== */

.recipe-browser {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
  }

.recipe-header {
    text-align: center;
    margin-bottom: 24px;
  }

.recipe-header h1 {
    font-size: 2rem;
    color: #d4af37;
    margin-bottom: 8px;
  }

.recipe-header .subtitle {
    color: #b0b0b0;
    font-size: 1rem;
  }

.recipe-browser .loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #b0b0b0;
  }

.recipe-browser .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
  }

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

  /* Controls */
.recipe-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
  }

.search-box-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 280px;
    max-width: 440px;
  }

.search-box {
    flex: 1;
  }

.search-clear-btn {
    padding: 8px 16px;
    background: #3a3a3a;
    border: 1px solid #4a4a4a;
    border-radius: 6px;
    color: #b0a080;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
  }

.search-clear-btn:hover {
    background: #4a4a4a;
    border-color: #d4af37;
    color: #d4af37;
  }

.results-count {
    color: #888;
    font-size: 14px;
  }

  /* Category Tabs - matches ConsumesShop */
.recipe-browser .category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    justify-content: center;
  }

.recipe-browser .category-tab {
    padding: 6px 14px;
    background: #2a2a2a;
    border: 2px solid #4a4a4a;
    border-radius: 6px;
    color: #b0a080;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
  }

.recipe-browser .category-tab:hover {
    border-color: #c9a959;
  }

.recipe-browser .category-tab.active {
    background: linear-gradient(135deg, #3d3d3d, #2a2a2a);
    border-color: #c9a959;
    color: #e0c89b;
  }

  /* Recipe Grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
  }

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #888;
  }

  /* Recipe Card */
.recipe-card {
    background: #252525;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 16px;
    transition: border-color 0.2s;
  }

.recipe-card:hover {
    border-color: #d4af37;
  }

.recipe-card-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
  }

.recipe-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 1px solid #4a4a4a;
    flex-shrink: 0;
  }

.recipe-icon-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 1px solid #4a4a4a;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 20px;
    flex-shrink: 0;
  }

.recipe-icon-loading {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 1px solid #4a4a4a;
    background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-shrink: 0;
    flex-shrink: 0;
  }

.recipe-title {
    flex: 1;
    min-width: 0;
  }

.recipe-name {
    font-size: 1rem;
    color: #e0e0e0;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
  }

.recipe-name:hover {
    color: #d4af37;
  }

.recipe-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #888;
  }

.recipe-meta .profession {
    color: #d4af37;
    text-transform: capitalize;
  }

.recipe-meta .yields {
    color: #58d68d;
  }

  /* Reagents */
  .reagents-section h4,
.demand-section h4 {
    font-size: 11px;
    color: #888;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

.recipe-browser .reagent-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

.recipe-browser .reagent {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #333;
    font-size: 13px;
  }

.recipe-browser .reagent:last-child {
    border-bottom: none;
  }

.recipe-browser .reagent-icon {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    flex-shrink: 0;
  }

.recipe-browser .reagent-icon-placeholder {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
  }

.recipe-browser .reagent-icon-loading {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-shrink: 0;
  }

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

.recipe-browser .reagent-name {
    flex: 1;
    color: #c0c0c0;
    text-decoration: none;
  }

.recipe-browser .reagent-name:hover {
    color: #d4af37;
  }

.recipe-browser .reagent-herb .reagent-name { color: #58d68d; }
.recipe-browser .reagent-vendor .reagent-name { color: #b0b0b0; }
.recipe-browser .reagent-drop .reagent-name { color: #e74c3c; }
.recipe-browser .reagent-crafted .reagent-name { color: #f39c12; }

.recipe-browser .reagent-qty {
    color: #d4af37;
    font-weight: 600;
    font-size: 12px;
  }

  /* Demand Section */
.demand-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #3a3a3a;
  }

.demand-section.empty {
    text-align: center;
  }

.demand-stats {
    margin-bottom: 6px;
  }

.demand-total {
    color: #5dade2;
    font-weight: 600;
    font-size: 13px;
  }

.herb-needs {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

.herb-need {
    font-size: 11px;
    color: #58d68d;
    padding-left: 8px;
  }

.no-demand {
    color: #666;
    font-size: 12px;
    font-style: italic;
  }

  /* Autocomplete overrides */
.search-box input {
    width: 100%;
    padding: 10px 14px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 14px;
  }

.search-box input:focus {
    outline: none;
    border-color: #d4af37;
  }

  /* Responsive */
@media (max-width: 768px) {
.recipe-controls {
      flex-direction: column;
      align-items: stretch;
    }

.search-box {
      max-width: none;
    }

.recipe-browser .category-tabs {
      flex-direction: column;
    }

.recipe-grid {
      grid-template-columns: 1fr;
    }
  }

/* ==================== LogReconciliation.tsx extracted styles ==================== */

.reconcile-container {
    max-width: 900px;
    margin: 0 auto;
  }

.status-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
  }

.status-card {
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid;
    background: var(--background-secondary);
  }

.status-card.good {
    border-color: var(--apple-green);
    background: linear-gradient(135deg, rgba(115, 191, 105, 0.1) 0%, rgba(115, 191, 105, 0.05) 100%);
  }

.status-card.warning {
    border-color: var(--apple-orange);
    background: linear-gradient(135deg, rgba(255, 152, 48, 0.1) 0%, rgba(255, 152, 48, 0.05) 100%);
  }

.status-card.error {
    border-color: var(--apple-red);
    background: linear-gradient(135deg, rgba(242, 73, 92, 0.1) 0%, rgba(242, 73, 92, 0.05) 100%);
  }

.status-icon {
    font-size: 32px;
    margin-bottom: 8px;
  }

.status-count {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
  }

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

.issues-panel {
    padding: 16px;
    background: rgba(255, 152, 48, 0.1);
    border-left: 3px solid var(--apple-orange);
    border-radius: 8px;
    margin-bottom: 24px;
  }

.issues-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
  }

.issue-item {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0;
  }

.success-panel {
    padding: 16px;
    background: rgba(115, 191, 105, 0.1);
    border-left: 3px solid var(--apple-green);
    border-radius: 8px;
    margin-bottom: 24px;
    color: var(--apple-green);
    font-weight: 600;
  }

.reprocess-info {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--background-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-light);
  }

.reprocess-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
  }

.reprocess-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
  }

.reprocess-description ul {
    margin: 12px 0 0 20px;
    padding: 0;
  }

.reprocess-description li {
    margin: 6px 0;
  }

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0;
    gap: 12px;
  }

.btn-select-toggle {
    padding: 8px 16px;
    background: var(--background-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
  }

.btn-select-toggle:hover:not(:disabled) {
    background: var(--background-secondary);
    border-color: var(--apple-blue);
  }

.btn-select-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

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

.sort-controls label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
  }

.sort-controls select {
    padding: 6px 10px;
    background: var(--background-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
  }

.sort-controls select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

.btn-sort-order {
    padding: 6px 12px;
    background: var(--background-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
  }

.btn-sort-order:hover:not(:disabled) {
    background: var(--background-secondary);
  }

.btn-sort-order:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

.log-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin: 12px 0;
  }

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

.log-table thead {
    position: sticky;
    top: 0;
    background: var(--background-tertiary);
    z-index: 10;
  }

.log-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-light);
  }

.log-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-primary);
  }

.log-table tbody tr {
    cursor: pointer;
    transition: background-color 0.15s;
  }

.log-table tbody tr:hover {
    background: var(--background-secondary);
  }

.log-table tbody tr.selected {
    background: rgba(0, 122, 255, 0.1);
  }

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

.log-id-cell {
    font-family: ui-monospace, monospace;
    font-size: 12px;
  }

.raid-cell {
    font-weight: 600;
  }

.reconcile-container .status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

.reconcile-container .status-badge.parsed {
    background: rgba(115, 191, 105, 0.2);
    color: var(--apple-green);
  }

.reconcile-container .status-badge.unparsed {
    background: rgba(255, 152, 48, 0.2);
    color: var(--apple-orange);
  }

.selection-summary {
    padding: 12px 16px;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--apple-blue);
    text-align: center;
    margin: 12px 0;
  }

.btn-reprocess-selected {
    width: 100%;
    padding: 12px;
    background: var(--apple-purple);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 24px;
  }

.btn-reprocess-selected:hover:not(:disabled) {
    background: #6c3ec7;
    transform: translateY(-1px);
  }

.btn-reprocess-selected:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

.btn-start {
    width: 100%;
    padding: 14px;
    background: var(--apple-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
  }

.btn-start:hover:not(:disabled) {
    background: var(--apple-blue-dark);
    transform: translateY(-1px);
  }

.btn-start:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

.phases-container {
    margin: 24px 0;
    padding: 20px;
    background: var(--background-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
  }

.phases-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
  }

.phase-item {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--background-tertiary);
    border-radius: 8px;
    border-left: 3px solid var(--border-light);
    transition: all 0.3s ease;
  }

.phase-item:last-child {
    margin-bottom: 0;
  }

.phase-item.pending {
    opacity: 0.6;
    border-left-color: var(--text-tertiary);
  }

.phase-item.in-progress {
    border-left-color: var(--apple-blue);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1) 0%, rgba(0, 122, 255, 0.05) 100%);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
  }

.phase-item.complete {
    border-left-color: var(--apple-green);
    background: linear-gradient(135deg, rgba(115, 191, 105, 0.1) 0%, rgba(115, 191, 105, 0.05) 100%);
  }

.phase-item.error {
    border-left-color: var(--apple-red);
    background: linear-gradient(135deg, rgba(242, 73, 92, 0.1) 0%, rgba(242, 73, 92, 0.05) 100%);
  }

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

.phase-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
  }

.phase-icon {
    display: inline-block;
    font-size: 16px;
  }

.phase-icon.spinning {
    animation: spin 1s linear infinite;
  }

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

.phase-status-text {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

.phase-item.pending .phase-status-text {
    color: var(--text-tertiary);
  }

.phase-item.in-progress .phase-status-text {
    color: var(--apple-blue);
  }

.phase-item.complete .phase-status-text {
    color: var(--apple-green);
  }

.phase-item.error .phase-status-text {
    color: var(--apple-red);
  }

.phase-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--background-primary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
  }

.phase-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--apple-blue), var(--apple-purple));
    transition: width 0.5s ease;
    border-radius: 4px;
  }

.phase-item.complete .phase-progress-fill {
    background: var(--apple-green);
  }

.phase-item.error .phase-progress-fill {
    background: var(--apple-red);
  }

.phase-details {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
  }

.phase-count {
    color: var(--apple-blue);
    font-weight: 600;
  }

.phase-current-item {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 6px;
    font-style: italic;
    padding: 4px 8px;
    background: var(--background-primary);
    border-radius: 4px;
    font-family: ui-monospace, monospace;
  }

.activity-log {
    margin-top: 24px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
  }

.activity-title {
    padding: 12px 16px;
    background: var(--background-tertiary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-light);
  }

.activity-entries {
    max-height: 300px;
    overflow-y: auto;
  }

.activity-entry {
    display: flex;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
  }

.activity-entry:last-child {
    border-bottom: none;
  }

.activity-entry.success {
    background: rgba(115, 191, 105, 0.05);
  }

.activity-entry.error {
    background: rgba(242, 73, 92, 0.05);
  }

.activity-entry.warning {
    background: rgba(255, 152, 48, 0.05);
  }

.activity-time {
    color: var(--text-tertiary);
    font-family: ui-monospace, monospace;
    flex-shrink: 0;
  }

.activity-message {
    color: var(--text-primary);
  }

  @media (max-width: 768px) {
.status-cards {
      grid-template-columns: 1fr;
    }
  }

/* ================================
   PHASE 4: Stock-Aware Demand Insights
   ================================ */

/* Stock Health summary card */
.stock-health-card {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.stock-health-stat {
  flex: 1;
  min-width: 80px;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid;
  text-align: center;
}

.stock-health-stat.critical { border-left-color: #f87171; }
.stock-health-stat.high { border-left-color: #f59e0b; }
.stock-health-stat.medium { border-left-color: #fbbf24; }
.stock-health-stat.low { border-left-color: #14b8a6; }
.stock-health-stat.ok { border-left-color: #22c55e; }

.stock-health-count {
  font-size: 1.25rem;
  font-weight: bold;
  color: #e0e0e0;
}

.stock-health-stat.critical .stock-health-count { color: #f87171; }
.stock-health-stat.high .stock-health-count { color: #f59e0b; }
.stock-health-stat.medium .stock-health-count { color: #fbbf24; }
.stock-health-stat.low .stock-health-count { color: #14b8a6; }
.stock-health-stat.ok .stock-health-count { color: #22c55e; }

.stock-health-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #9ca3af;
  margin-top: 2px;
}

/* Enhanced reagent demand row (Phase 4) */
.reagent-demand-row-enhanced {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

/* Resolved-from footnote spans full row */
.reagent-demand-row-enhanced .reagent-resolved-note {
  grid-column: 1 / -1;
}

/* Stock data cells */
.reagent-stock-data {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.reagent-stock-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 40px;
}

.reagent-stock-label {
  font-size: 0.6rem;
  color: #808080;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reagent-stock-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e0e0e0;
}

.reagent-stock-value.gap-warning {
  color: #f87171;
}

/* Priority badges */
.priority-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.priority-badge.critical { background: rgba(248, 113, 113, 0.2); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }
.priority-badge.high { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.priority-badge.medium { background: rgba(251, 191, 36, 0.2); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.priority-badge.low { background: rgba(20, 184, 166, 0.2); color: #14b8a6; border: 1px solid rgba(20, 184, 166, 0.3); }
.priority-badge.ok { background: rgba(34, 197, 94, 0.2); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.3); }

/* Resolved-from footnote */
.reagent-resolved-note {
  font-size: 0.72rem;
  font-style: italic;
  color: #9ca3af;
  padding-left: 2rem;
  margin-top: -0.25rem;
}

/* Inline sources fallback when no priority data */
.reagent-demand-sources-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.75rem;
}

/* Demand badge on material cards */
.demand-badge-card {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 3px;
  z-index: 1;
}

.demand-badge-card.critical { background: rgba(239, 68, 68, 0.25); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.demand-badge-card.med { background: rgba(245, 158, 11, 0.25); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.demand-badge-card.low { background: rgba(107, 114, 128, 0.2); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.3); }

/* item-card needs position:relative for badge overlay */
.item-card { position: relative; }

/* Sort by urgency toggle button */
.sort-urgency-btn {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.sort-urgency-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.sort-urgency-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

/* Banner stock detail line */
.demand-herb-stock-detail {
  font-size: 0.6rem;
  color: #9ca3af;
  display: block;
  margin-top: 1px;
}

/* Banner resolved-from line (e.g. "via Shadow Oil") */
.demand-herb-resolved {
  font-size: 0.55rem;
  color: #6b7280;
  display: block;
  font-style: italic;
}

/* View Full Demand link in banner */
.demand-view-full-link {
  display: block;
  text-align: right;
  color: #5794f2;
  font-size: 0.75rem;
  text-decoration: none;
  padding: 6px 12px 2px 0;
  transition: color 0.2s;
}
.demand-view-full-link:hover { color: #7cb3ff; }

/* Stock health summary stats line */
.stock-health-summary-line {
  display: flex;
  gap: 1.2rem;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.75rem;
  color: #9ca3af;
  width: 100%;
  justify-content: center;
}

/* Double Whammy badge */
.double-whammy-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
  cursor: help;
  letter-spacing: 0.03em;
}

/* Responsive: stack stock data on narrow screens */
@media (max-width: 768px) {
  .reagent-demand-row-enhanced {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .reagent-stock-data {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .stock-health-card {
    gap: 0.35rem;
  }
  .stock-health-stat {
    min-width: 55px;
    padding: 0.4rem 0.5rem;
  }
  .stock-health-count {
    font-size: 1rem;
  }
}

/* ================================
   REDESIGNED DEMAND INSIGHTS
   ================================ */

/* Bank Coverage Card */
.bank-coverage-card {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.bank-coverage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.bank-coverage-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.bank-coverage-pct {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e0e0e0;
}

.bank-coverage-bar-track {
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.bank-coverage-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}

.bank-coverage-bar-fill.critical { background: linear-gradient(90deg, #ef4444, #f87171); }
.bank-coverage-bar-fill.medium { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bank-coverage-bar-fill.ok { background: linear-gradient(90deg, #22c55e, #4ade80); }

.bank-coverage-desc {
  font-size: 0.8rem;
  color: #9ca3af;
  line-height: 1.5;
  margin: 0;
}

.bank-coverage-alert {
  margin-top: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  font-size: 0.8rem;
  color: #fca5a5;
}

/* Clickable tier badges */
.stock-health-stat.clickable {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.stock-health-stat.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stock-health-days {
  font-size: 0.55rem;
  color: #6b7280;
  margin-top: 2px;
}

/* ── Restock Now Table ── */
.restock-table {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0.75rem;
}

.restock-table .restock-header {
  display: grid;
  grid-template-columns: 30px 1.5fr 70px 80px 70px 100px 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #6b7280;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.restock-row {
  display: grid;
  grid-template-columns: 30px 1.5fr 70px 80px 70px 100px 1fr;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  align-items: center;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}

.restock-row:hover { background: rgba(255, 255, 255, 0.03); }

.restock-row-critical {
  background: rgba(239, 68, 68, 0.06);
  border-left: 3px solid #f87171;
}

.restock-col-rank {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-align: center;
}

.restock-col-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.restock-name-main {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.restock-via {
  font-size: 0.7rem;
  font-style: italic;
  color: #6b7280;
  padding-left: 1.75rem;
}

.restock-col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #e0e0e0;
}

.restock-have { color: #22c55e; }
.restock-short { color: #f87171; font-weight: 600; }

.restock-col-runs {
  text-align: center;
  font-weight: 600;
}

.restock-danger { color: #f87171; }
.restock-warn { color: #fbbf24; }

.restock-col-used {
  font-size: 0.75rem;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Double Hit badge */
.double-hit-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
  letter-spacing: 0.03em;
  margin-left: 0.35rem;
  flex-shrink: 0;
}

/* Copy Shopping List button */
.copy-shopping-list-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.copy-shopping-list-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
}

.copy-hint {
  font-size: 0.75rem;
  color: #6b7280;
  margin-left: 0.75rem;
}

/* ── Filter Pills + Sort Controls ── */
.reagent-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.reagent-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.reagent-filter-pill {
  padding: 0.3rem 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #9ca3af;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.reagent-filter-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}

.reagent-filter-pill.active {
  background: rgba(93, 173, 226, 0.15);
  border-color: rgba(93, 173, 226, 0.4);
  color: #5dade2;
}

.reagent-sort-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.sort-label {
  font-size: 0.7rem;
  color: #6b7280;
  margin-right: 0.2rem;
}

.reagent-sort-btn {
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 0.7rem;
  color: #9ca3af;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.reagent-sort-btn:hover { background: rgba(255, 255, 255, 0.1); color: #e0e0e0; }
.reagent-sort-btn.active { background: rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.4); color: #fbbf24; }

/* ── Tier Groups (Collapsible Priority Sections) ── */
.tier-groups {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tier-group {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.9rem;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
  font-size: 0.8rem;
}

.tier-header:hover { background: rgba(0, 0, 0, 0.4); }

.tier-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tier-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tier-header-right {
  font-size: 0.75rem;
  color: #6b7280;
}

.tier-header.critical { border-left: 3px solid #f87171; }
.tier-header.high { border-left: 3px solid #f59e0b; }
.tier-header.medium { border-left: 3px solid #fbbf24; }
.tier-header.low { border-left: 3px solid #14b8a6; }
.tier-header.ok { border-left: 3px solid #22c55e; }

.tier-body {
  padding: 0;
}

/* Column headers */
.tier-col-headers {
  display: grid;
  grid-template-columns: 60px 1.2fr 1.5fr 60px 60px 1fr;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #6b7280;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
}

/* Tier row */
.tier-row {
  display: grid;
  grid-template-columns: 60px 1.2fr 1.5fr 60px 60px 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  align-items: center;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.15s;
}

.tier-row:hover { background: rgba(255, 255, 255, 0.03); }

.tier-col-urgency {
  font-weight: 700;
  font-size: 0.75rem;
  text-align: center;
  color: #9ca3af;
}

.urgency-dead { color: #f87171; }
.urgency-critical { color: #fbbf24; }

.tier-col-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.tier-name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tier-via {
  font-size: 0.68rem;
  font-style: italic;
  color: #6b7280;
  padding-left: 1.75rem;
}

/* Stacked have/short bar */
.tier-col-bar {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stacked-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.stacked-bar-have {
  background: #22c55e;
  min-width: 0;
  transition: width 0.3s;
}

.stacked-bar-short {
  background: #ef4444;
  min-width: 0;
  transition: width 0.3s;
}

.stacked-bar-label {
  font-size: 0.6rem;
  color: #6b7280;
}

.tier-col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
}

.tier-have { color: #22c55e; }
.tier-short { color: #f87171; font-weight: 600; }
.tier-ok { color: #22c55e; }

.tier-col-used {
  font-size: 0.72rem;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Show more button inside tier */
.tier-show-more {
  display: block;
  width: 100%;
  padding: 0.5rem;
  background: rgba(93, 173, 226, 0.08);
  border: none;
  color: #5dade2;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s;
}

.tier-show-more:hover { background: rgba(93, 173, 226, 0.15); }

/* Stacked bar legend */
.stacked-bar-legend {
  display: flex;
  gap: 1.2rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.68rem;
  color: #6b7280;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.legend-swatch.have { background: #22c55e; }
.legend-swatch.short { background: #ef4444; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .restock-table .restock-header,
  .restock-row {
    grid-template-columns: 25px 1fr 55px 65px 55px;
    font-size: 0.72rem;
  }
  .restock-col-runs,
  .restock-col-used { display: none; }

  .tier-col-headers,
  .tier-row {
    grid-template-columns: 45px 1fr 1.2fr 50px 50px;
    font-size: 0.72rem;
  }
  .tier-col-used { display: none; }

  .reagent-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .bank-coverage-pct { font-size: 1.2rem; }
}

/* Guild Bank table row hover */
.guild-bank-row:hover { background: var(--background-tertiary); }

/* ================================
   SHOP STOCK STATUS SECTION
   ================================ */
.shop-stock-section {
  margin-bottom: 8px;
}

.shop-stock-subtitle {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 16px 0;
}

.shop-stock-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.shop-stock-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-stock-badge .badge-count {
  font-size: 1rem;
  font-weight: 700;
}

.shop-stock-badge.out-of-stock { background: rgba(220, 38, 38, 0.15); color: #fca5a5; border-color: rgba(220, 38, 38, 0.3); }
.shop-stock-badge.critical { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border-color: rgba(248, 113, 113, 0.25); }
.shop-stock-badge.low-stock { background: rgba(251, 191, 36, 0.12); color: #fde68a; border-color: rgba(251, 191, 36, 0.25); }
.shop-stock-badge.in-stock { background: rgba(20, 184, 166, 0.12); color: #5eead4; border-color: rgba(20, 184, 166, 0.25); }
.shop-stock-badge.surplus { background: rgba(34, 197, 94, 0.12); color: #86efac; border-color: rgba(34, 197, 94, 0.25); }

.shop-stock-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.shop-stock-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  padding: 10px 0 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 4px;
}

.shop-stock-category:first-child { margin-top: 0; }

.shop-stock-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.82rem;
}

.shop-stock-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.stock-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1a1a1a;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.stock-item-icon-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}

.shop-stock-row .stock-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-stock-row .stock-item-name a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 500;
}

.shop-stock-row .stock-item-name a:hover {
  color: #5dade2;
  text-decoration: underline;
}

.shop-stock-row .stock-item-count {
  font-weight: 600;
  min-width: 30px;
  text-align: right;
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}

.shop-stock-level {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  text-transform: uppercase;
}

.shop-stock-level.out-of-stock { background: rgba(220, 38, 38, 0.2); color: #fca5a5; }
.shop-stock-level.critical { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }
.shop-stock-level.low-stock { background: rgba(251, 191, 36, 0.15); color: #fde68a; }

.shop-stock-toggle {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 8px 16px;
  border-radius: 6px;
  margin-top: 12px;
}

.shop-stock-toggle:hover { background: rgba(255, 255, 255, 0.04); color: rgba(255, 255, 255, 0.8); }

.shop-stock-empty {
  text-align: center;
  padding: 24px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
}

/* ================================
   DAILY TRENDS LINE CHART
   ================================ */
.trend-line-chart {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  padding: 16px;
  margin-top: 12px;
}

.trend-line-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.trend-line-chart-svg {
  width: 100%;
  height: 200px;
}

.trend-period-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.trend-period-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  padding: 4px 14px;
  border-radius: 16px;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
}

.trend-period-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}

.trend-period-pill.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  font-weight: 600;
}

/* ================================
   RESPONSIVE: SHOP STOCK & TRENDS
   ================================ */
@media (max-width: 768px) {
  .shop-stock-summary { gap: 6px; }
  .shop-stock-badge { padding: 4px 10px; font-size: 0.72rem; }
  .shop-stock-row .stock-item-cat { display: none; }
  .trend-line-chart-svg { height: 160px; }
}

/* ================================
   RECIPE BROWSER: EXPANDABLE SUB-RECIPES
   ================================ */
.recipe-browser .reagent-main { display: flex; align-items: center; gap: 6px; }
.recipe-browser .reagent-crafted .sub-recipe-toggle { cursor: pointer; padding: 2px 8px 2px 4px; margin: -2px -4px; border-radius: 6px; background: rgba(243, 156, 18, 0.08); border: 1px solid rgba(243, 156, 18, 0.2); transition: background 0.15s, border-color 0.15s; }
.recipe-browser .reagent-crafted .sub-recipe-toggle:hover { background: rgba(243, 156, 18, 0.15); border-color: rgba(243, 156, 18, 0.4); }
.recipe-browser .sub-recipe-arrow { font-size: 0.75rem; margin-left: 8px; transition: transform 0.2s; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 4px; background: rgba(243, 156, 18, 0.2); color: #f39c12; line-height: 1; }
.recipe-browser .sub-recipe-arrow.expanded { transform: rotate(90deg); background: rgba(243, 156, 18, 0.3); }
.recipe-browser .sub-recipe-list { margin: 4px 0 4px 24px; padding: 6px 0 6px 12px; border-left: 2px solid rgba(243, 156, 18, 0.3); list-style: none; }
.recipe-browser .sub-recipe-list .reagent { padding: 2px 0; font-size: 0.85em; display: flex; align-items: center; gap: 6px; }
.recipe-browser .raw-materials-summary { margin-top: 8px; padding: 8px 12px; background: rgba(255,255,255,0.03); border-radius: 6px; border: 1px solid rgba(255,255,255,0.06); }
.recipe-browser .raw-materials-summary h5 { font-size: 0.75rem; color: #888; margin: 0 0 6px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.recipe-browser .raw-material-pill { display: inline-block; font-size: 0.72rem; padding: 2px 8px; margin: 2px 4px 2px 0; border-radius: 10px; background: rgba(255,255,255,0.05); }
.recipe-browser .raw-material-herb { color: #58d68d; border: 1px solid rgba(88,214,141,0.25); }
.recipe-browser .raw-material-drop { color: #e74c3c; border: 1px solid rgba(231,76,60,0.25); }
.recipe-browser .raw-material-vendor { color: #b0b0b0; border: 1px solid rgba(176,176,176,0.2); }
.recipe-browser .raw-material-other { color: #999; border: 1px solid rgba(153,153,153,0.2); }

/* ================================
   CONSUMES QUEUE: BANK CROSS-REFERENCE
   ================================ */
.order-item-stock { display: inline-block; font-size: 0.72rem; margin-left: 8px; padding: 1px 6px; border-radius: 8px; }
.order-item-stock.sufficient { color: #58d68d; background: rgba(88,214,141,0.1); }
.order-item-stock.partial { color: #fbbf24; background: rgba(251,191,36,0.1); }
.order-item-stock.short { color: #f87171; background: rgba(248,113,113,0.1); }
.priority-farm-summary { margin-top: 8px; padding: 6px 10px; background: rgba(88,214,141,0.06); border: 1px solid rgba(88,214,141,0.15); border-radius: 6px; font-size: 0.72rem; }
.priority-farm-summary .farm-title { color: #58d68d; font-weight: 600; margin-right: 6px; }
.priority-farm-summary .farm-item { color: #ccc; margin-right: 4px; }
.priority-farm-summary .farm-qty { color: #fbbf24; }

/* Tray app update notification banner — guild-bank page */
.tray-update-banner { background: linear-gradient(135deg, #1a3a2a, #0d2818); border: 1px solid #2d6b45; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; animation: slideDown 0.3s ease-out; }
.tray-update-content { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tray-update-icon { font-size: 1.3rem; flex-shrink: 0; }
.tray-update-text { flex: 1; min-width: 200px; color: #b8d4c8; font-size: 0.9rem; }
.tray-update-text strong { color: #5ddb8a; }
.tray-update-changelog { color: #7aaa94; }
.tray-update-download { background: #2d6b45; color: #fff; padding: 6px 14px; border-radius: 6px; text-decoration: none; font-weight: bold; font-size: 0.85rem; white-space: nowrap; transition: background 0.2s; }
.tray-update-download:hover { background: #3a8a5a; }
.tray-update-dismiss { background: none; border: none; color: #5a7a6a; font-size: 1.1rem; cursor: pointer; padding: 4px 8px; line-height: 1; transition: color 0.2s; }
.tray-update-dismiss:hover { color: #8ab8a0; }
@media (max-width: 600px) { .tray-update-content { gap: 8px; } .tray-update-text { font-size: 0.82rem; } }
