/* ==========================================
   Asoventure Asset — Premium Dark Financial UI
   ========================================== */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --bg-card-hover: #222940;
    --bg-elevated: #252d3f;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text: #e2e8f0;
    --text-dim: #94a3b8;
    --text-muted: #64748b;
    --accent: #f59e0b;
    --accent-glow: rgba(245, 158, 11, 0.2);
    --green: #10b981;
    --green-bg: rgba(16, 185, 129, 0.1);
    --green-glow: rgba(16, 185, 129, 0.3);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.1);
    --blue: #3b82f6;
    --blue-bg: rgba(59, 130, 246, 0.1);
    --yellow: #f59e0b;
    --yellow-bg: rgba(245, 158, 11, 0.1);
    --purple: #a855f7;
    --sidebar-w: 260px;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================
   Sidebar
   ========================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.logo-mark {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent), #d97706);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: #0a0e17;
    box-shadow: 0 4px 16px var(--accent-glow);
    flex-shrink: 0;
}

.logo-title {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.logo-sub {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.nav-section {
    padding: 1rem 0.75rem;
}

.nav-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    font-family: inherit;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.08));
    color: var(--accent);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--accent), #d97706);
    color: #0a0e17;
    letter-spacing: 0.05em;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1.25rem;
    border-top: 1px solid var(--border);
}

.tagline {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    line-height: 1.5;
}

/* ==========================================
   Mobile Nav
   ========================================== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0.25rem;
    z-index: 100;
    justify-content: space-around;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.4rem 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    font-family: inherit;
}

.mobile-nav-item span:first-child {
    font-size: 1.2rem;
}

.mobile-nav-item.active {
    color: var(--accent);
}

/* ==========================================
   Main Content
   ========================================== */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 2rem;
    padding-bottom: 4rem;
}

.page {
    display: none;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* ==========================================
   Page Header
   ========================================== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.last-updated {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #d97706);
    color: #0a0e17;
    border-color: transparent;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-dim);
    border-color: var(--border-hover);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(245, 158, 11, 0.05);
}

.btn-accent {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
    border-color: rgba(245, 158, 11, 0.3);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

.btn-analyze {
    width: 100%;
    justify-content: center;
    font-size: 1rem;
    padding: 1rem;
    margin: 1rem 0;
}

/* ==========================================
   Summary Cards (Dashboard)
   ========================================== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.card-total::before {
    background: linear-gradient(90deg, var(--accent), #d97706);
}

.card-profit::before {
    background: linear-gradient(90deg, var(--green), #34d399);
}

.card-count::before {
    background: linear-gradient(90deg, var(--blue), #60a5fa);
}

.card-cost::before {
    background: linear-gradient(90deg, var(--purple), #c084fc);
}

.summary-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.summary-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    flex-shrink: 0;
}

.summary-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.summary-change {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.15rem;
}

.summary-change.positive {
    color: var(--green);
}

.summary-change.negative {
    color: var(--red);
}

/* ==========================================
   Chart Cards
   ========================================== */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.chart-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.chart-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.chart-body {
    padding: 1.25rem;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* ==========================================
   Activity Card
   ========================================== */
.activity-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.activity-list {
    padding: 0.75rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.activity-icon.buy {
    background: var(--green-bg);
}

.activity-icon.sell {
    background: var(--red-bg);
}

.activity-icon.scan {
    background: var(--blue-bg);
}

.activity-icon.hold {
    background: var(--yellow-bg);
}

.activity-info {
    flex: 1;
}

.activity-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.activity-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.activity-meta {
    text-align: right;
}

.activity-amount {
    font-size: 0.85rem;
    font-weight: 700;
}

.activity-date {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* ==========================================
   Empty State
   ========================================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.empty-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

.empty-state-sm {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================
   The Compass
   ========================================== */
.compass-layout {
    max-width: 900px;
}

.compass-upload-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.upload-zone {
    padding: 3rem 2rem;
    text-align: center;
    border: 2px dashed var(--border-hover);
    border-radius: var(--radius);
    margin: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.05);
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.7;
}

.upload-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.upload-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.upload-preview {
    padding: 1rem;
    text-align: center;
}

.upload-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 0.75rem;
}

.api-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--yellow-bg);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-sm);
    margin: 1rem 0;
}

.notice-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notice-text {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.notice-text .btn {
    margin-left: 0.5rem;
}

/* Analysis Results */
.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.result-card-advice {
    grid-column: 1 / -1;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.result-header h3 {
    font-size: 0.85rem;
    font-weight: 700;
}

.result-icon {
    font-size: 1.1rem;
}

.result-body {
    padding: 1rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.result-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.condition-grade {
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    padding: 0.5rem;
    line-height: 1;
}

.condition-grade.grade-S {
    color: var(--accent);
}

.condition-grade.grade-A {
    color: var(--green);
}

.condition-grade.grade-B {
    color: var(--blue);
}

.condition-grade.grade-C {
    color: var(--red);
}

.condition-desc {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

/* Price Range */
.price-range {
    display: flex;
    gap: 0.5rem;
}

.price-range>div {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
}

.price-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.price-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
}

.price-low .price-value {
    color: var(--blue);
}

.price-mid .price-value {
    color: var(--accent);
}

.price-high .price-value {
    color: var(--green);
}

/* Market Meta & Sources */
.market-meta {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.market-trend {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
}

.market-trend.up {
    background: var(--green-bg);
    color: var(--green);
}

.market-trend.stable {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.market-trend.down {
    background: var(--red-bg);
    color: var(--red);
}

.market-source {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
}

.market-sources {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.market-sources-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.market-source-link {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--blue);
    text-decoration: none;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
    padding: 0.15rem 0.4rem;
    background: var(--blue-bg);
    border-radius: var(--radius-xs);
    transition: var(--transition);
}

.market-source-link:hover {
    opacity: 0.8;
}

/* Advice */
.advice-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.advice-badge.buy {
    background: var(--green-bg);
    color: var(--green);
}

.advice-badge.hold {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.advice-badge.sell {
    background: var(--red-bg);
    color: var(--red);
}

.advice-reason {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.7;
}

.result-actions {
    display: flex;
    gap: 0.75rem;
}

/* Scan History */
.scan-history {
    margin-top: 2rem;
}

.scan-history h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.scan-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.scan-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

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

.scan-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.scan-thumb {
    width: 40px;
    height: 56px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.scan-info {
    flex: 1;
}

.scan-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.scan-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ==========================================
   Upload Actions & Camera
   ========================================== */
.upload-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==========================================
   Preview Grid (Multiple Images)
   ========================================== */
.preview-grid-container {
    padding: 1rem;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
}

.preview-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
}

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

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

.preview-thumb {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}

.preview-thumb:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-thumb .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    line-height: 1;
}

.preview-thumb:hover .remove-btn {
    opacity: 1;
}

.preview-thumb .thumb-index {
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text);
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   Batch Progress
   ========================================== */
.batch-progress {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin: 1rem 0;
}

.batch-progress-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.batch-progress-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.batch-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 4px;
    overflow: hidden;
}

.batch-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #d97706);
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* ==========================================
   Batch Results
   ========================================== */
.batch-results {
    margin: 1rem 0;
}

.batch-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.batch-results-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
}

.batch-results-summary {
    font-size: 0.8rem;
    color: var(--text-dim);
    background: var(--bg-card);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
}

.batch-result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: var(--transition);
    cursor: pointer;
}

.batch-result-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.batch-result-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.batch-result-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.batch-result-card-grade {
    font-size: 1.1rem;
    font-weight: 900;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-xs);
    background: var(--bg-elevated);
}

.batch-result-card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.batch-result-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.batch-result-card-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
    margin-left: auto;
}

.batch-result-card-advice {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
}

.batch-result-card-advice.buy {
    background: var(--green-bg);
    color: var(--green);
}

.batch-result-card-advice.hold {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.batch-result-card-advice.sell {
    background: var(--red-bg);
    color: var(--red);
}

.batch-result-card .error-tag {
    font-size: 0.75rem;
    color: var(--red);
    font-weight: 600;
}

/* ==========================================
   Price Update Progress
   ========================================== */
.price-update-progress {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.price-update-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.price-update-icon {
    font-size: 1.2rem;
}

.price-update-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

/* ==========================================
   The Vault
   ========================================== */
.vault-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-select,
.filter-input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
    font-family: inherit;
    transition: var(--transition);
    min-width: 160px;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-input {
    min-width: 220px;
}

/* Vault Grid — Mercari-style Product Listing */
.vault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.vault-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.vault-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Square thumbnail */
.vault-item-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    /* 1:1 aspect ratio */
    background: var(--bg-elevated);
    overflow: hidden;
}

.vault-item-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.vault-item:hover .vault-item-image img {
    transform: scale(1.05);
}

.vault-item-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    opacity: 0.2;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
}

/* Category badge on image */
.vault-item-category {
    position: absolute;
    bottom: 0.4rem;
    left: 0.4rem;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.65);
    color: var(--text);
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* Condition badge on image */
.vault-item-condition {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    font-size: 0.6rem;
    font-weight: 800;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    z-index: 2;
}

.vault-item-condition.grade-S {
    background: var(--yellow-bg);
    color: var(--accent);
}

.vault-item-condition.grade-A {
    background: var(--green-bg);
    color: var(--green);
}

.vault-item-condition.grade-B {
    background: var(--blue-bg);
    color: var(--blue);
}

.vault-item-condition.grade-C {
    background: var(--red-bg);
    color: var(--red);
}

/* Item body — compact info area */
.vault-item-body {
    padding: 0.6rem 0.5rem;
}

.vault-item-name {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.vault-item-sub {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Price display — Mercari style */
.vault-item-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
}

.vault-item-prices {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.vault-price-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.vault-price-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
}

.vault-price-pnl {
    font-size: 0.65rem;
    font-weight: 700;
}

.vault-price-pnl.positive {
    color: var(--green);
}

.vault-price-pnl.negative {
    color: var(--red);
}

/* Price source & trend */
.vault-price-source {
    font-size: 0.55rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
    cursor: help;
    line-height: 1.3;
}

.vault-trend {
    font-size: 0.7rem;
    line-height: 1;
}

.vault-trend-up {
    filter: hue-rotate(0deg);
}

.vault-trend-down {
    filter: hue-rotate(0deg);
}

/* Item actions — show on hover */
.vault-item-actions {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    padding: 2rem 0.5rem 0.5rem;
    gap: 0.35rem;
    z-index: 3;
}

.vault-item:hover .vault-item-actions {
    display: flex;
}

.vault-item-actions .btn {
    flex: 1;
    font-size: 0.65rem;
    padding: 0.3rem 0.4rem;
}

/* Quantity badge */
.vault-item-qty {
    position: absolute;
    top: 0.4rem;
    left: 0.4rem;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: rgba(245, 158, 11, 0.85);
    color: #0a0e17;
    z-index: 2;
}

/* Items count badge */
.vault-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

/* Marketplace links — card (icon style) */
.vault-marketplace-links {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

.marketplace-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 0.7rem;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.marketplace-icon:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
    transform: scale(1.15);
}

/* Marketplace links — modal (full style) */
.marketplace-links-full {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.marketplace-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.marketplace-link:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
    transform: translateY(-1px);
}

.marketplace-link span {
    font-size: 0.85rem;
}

/* ==========================================
   Modals
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

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

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: var(--transition);
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
}

.required {
    color: var(--red);
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
    resize: vertical;
}

.input-with-prefix {
    display: flex;
    align-items: center;
}

.input-prefix {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-right: none;
    padding: 0.6rem 0.5rem;
    border-radius: var(--radius-xs) 0 0 var(--radius-xs);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.input-with-prefix input {
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    flex: 1;
}

.image-upload-zone {
    padding: 1.5rem;
    text-align: center;
    border: 2px dashed var(--border-hover);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.image-upload-zone:hover {
    border-color: var(--accent);
}

.image-preview {
    text-align: center;
    padding: 0.5rem 0;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

/* Price source info in modal */
.price-source-info {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.price-source-row {
    margin-bottom: 0.5rem;
}

.price-source-row strong {
    color: var(--text);
}

.price-trend-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Market prices grid (sold/listing/buyback) */
.market-prices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.market-price-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
    text-align: center;
}

.market-price-card.sold {
    border-color: var(--green);
    border-left: 3px solid var(--green);
}

.market-price-card.listing {
    border-color: var(--blue);
    border-left: 3px solid var(--blue);
}

.market-price-card.buyback {
    border-color: var(--accent);
    border-left: 3px solid var(--accent);
}

.market-price-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.market-price-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
}

.market-price-range {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Marketplace price list */
.mp-price-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
    padding: 0.4rem 0;
    border-top: 1px solid var(--border);
}

.mp-price-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.mp-name {
    min-width: 80px;
    font-weight: 600;
    color: var(--text);
}

.mp-value {
    font-weight: 800;
    color: var(--accent);
}

.mp-note {
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* Trend & advice badges */
.trend-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.trend-badge.trend-up {
    background: var(--green-bg);
    color: var(--green);
}

.trend-badge.trend-stable {
    background: var(--blue-bg);
    color: var(--blue);
}

.trend-badge.trend-down {
    background: var(--red-bg);
    color: var(--red);
}

.advice-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.advice-badge.advice-buy {
    background: var(--green-bg);
    color: var(--green);
}

.advice-badge.advice-hold {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.advice-badge.advice-sell {
    background: var(--red-bg);
    color: var(--red);
}

.trend-description,
.advice-reason {
    margin-top: 0.4rem;
    font-size: 0.72rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.advice-reason {
    padding: 0.35rem 0.5rem;
    background: rgba(139, 92, 246, 0.08);
    border-radius: 4px;
    border-left: 2px solid var(--accent);
}

.source-label {
    margin-top: 0.3rem;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.price-updated-at {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ==========================================
   Adventure Log
   ========================================== */
.log-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.log-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.log-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.timeline-dot {
    position: absolute;
    left: -1.6rem;
    top: 0.25rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
}

.timeline-dot.buy {
    background: var(--green);
}

.timeline-dot.sell {
    background: var(--red);
}

.timeline-dot.hold {
    background: var(--yellow);
}

.timeline-dot.research {
    background: var(--blue);
}

.timeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: var(--transition);
}

.timeline-card:hover {
    border-color: var(--border-hover);
}

.timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.timeline-action {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.timeline-action.buy {
    background: var(--green-bg);
    color: var(--green);
}

.timeline-action.sell {
    background: var(--red-bg);
    color: var(--red);
}

.timeline-action.hold {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.timeline-action.research {
    background: var(--blue-bg);
    color: var(--blue);
}

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

.timeline-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.timeline-reason {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.timeline-amount {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.timeline-result {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-result .positive {
    color: var(--green);
    font-weight: 700;
}

.timeline-result .negative {
    color: var(--red);
    font-weight: 700;
}

.timeline-delete {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: var(--transition);
}

.timeline-card:hover .timeline-delete {
    opacity: 1;
}

/* ==========================================
   Settings
   ========================================== */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 700px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.settings-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.settings-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.settings-desc a {
    color: var(--accent);
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.settings-input {
    flex: 1;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    font-family: inherit;
    transition: var(--transition);
}

.settings-input:focus {
    outline: none;
    border-color: var(--accent);
}

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

.settings-card.danger {
    border-color: rgba(239, 68, 68, 0.2);
}

.api-status {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.api-status.success {
    color: var(--green);
}

.api-status.error {
    color: var(--red);
}

.data-stats {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================
   Footer Bar
   ========================================== */
.footer-bar {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-w);
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 0.5rem 1.5rem;
    font-size: 0.65rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 50;
}

.footer-bar a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-bar a:hover {
    color: var(--accent);
}

.footer-sep {
    opacity: 0.3;
}

.footer-links-az {
    margin-left: auto;
    display: flex;
    gap: 0.35rem;
}

.footer-links-az a {
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    transition: var(--transition);
}

.footer-links-az a:hover {
    background: var(--accent-glow);
    color: var(--accent);
}

/* ==========================================
   Loading spinner
   ========================================== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1024px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

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

    .mobile-nav {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-bottom: 5rem;
    }

    .footer-bar {
        display: none;
    }

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

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

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

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

    .form-group.full-width {
        grid-column: 1;
    }

    .vault-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .page-header {
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
    }

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

    .modal {
        width: 95%;
        max-height: 90vh;
    }
}

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

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

    .price-range {
        flex-direction: column;
    }
}

/* ==========================================
   Scrollbar
   ========================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================
   Toast Notifications
   ========================================== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    max-width: 350px;
}

.toast.success {
    border-left: 3px solid var(--green);
}

.toast.error {
    border-left: 3px solid var(--red);
}

.toast.info {
    border-left: 3px solid var(--blue);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}