/* Steamify Web — Application Styles */

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow: hidden;
}

/* ========== Layout ========== */

.app-layout {
    display: flex;
    height: calc(100vh - 56px - 32px); /* header + status bar */
    overflow: hidden;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
    background:
        radial-gradient(ellipse 50% 60% at 0% 0%, rgba(139, 92, 246, 0.18), transparent),
        radial-gradient(ellipse 40% 50% at 100% 100%, rgba(6, 182, 212, 0.12), transparent),
        radial-gradient(ellipse 35% 40% at 60% 20%, rgba(59, 130, 246, 0.08), transparent),
        var(--bg-primary);
    background-attachment: fixed;
}

/* ========== Header ========== */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    position: relative;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.header-actions .btn:not(.btn-icon) {
    height: 34px;
    width: 110px;
    padding: 0 8px;
    white-space: nowrap;
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-xl);
    font-size: var(--text-xs);
    font-weight: 600;
}

.status-badge.running {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-online);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.stopped {
    background: rgba(107, 114, 128, 0.15);
    color: var(--status-offline);
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* ========== Sidebar ========== */

.sidebar {
    width: 210px;
    min-width: 210px;
    background: var(--glass-bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(139, 92, 246, 0.12);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 5;
}

/* Logo / brand */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 16px 14px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    margin-bottom: 4px;
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

.sidebar-logo-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: linear-gradient(135deg, #c4b5fd 0%, #67e8f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Section groups */
.sidebar-section {
    padding: 6px 0 2px;
}

.sidebar-section-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 4px 16px 2px;
    opacity: 0.6;
}

.sidebar-divider {
    height: 1px;
    background: rgba(139, 92, 246, 0.08);
    margin: 4px 12px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 10px 16px;
    font-size: 10px;
    color: var(--text-tertiary);
    opacity: 0.4;
    border-top: 1px solid rgba(139, 92, 246, 0.07);
}

/* Nav items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    margin: 1px 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 450;
    transition: all 0.18s ease;
    cursor: pointer;
    border-radius: 8px;
    border-left: none;
    position: relative;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.08);
}

.nav-item:hover .nav-icon {
    color: var(--accent-purple);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(6, 182, 212, 0.15) 100%);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.2), inset 0 1px 0 rgba(255,255,255,0.05);
}

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

.nav-item.active .nav-label {
    font-weight: 600;
}

.nav-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: color 0.18s ease;
}

.nav-icon svg {
    width: 15px;
    height: 15px;
}

.nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== Status Bar ========== */

.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 32px;
    padding: 0 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(139, 92, 246, 0.1);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    position: relative;
    z-index: 10;
}

/* ========== Buttons ========== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    min-height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--bg-elevated);
    color: var(--text-primary);
    text-decoration: none;
    box-sizing: border-box;
}

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

.btn:disabled, .btn.htmx-request {
    opacity: 0.5;
    pointer-events: none;
}

.btn-muted {
    opacity: 0.3;
    filter: grayscale(1);
}

.btn-icon {
    padding: 4px 8px;
    font-size: 16px;
    line-height: 1;
    min-width: 32px;
    min-height: 32px;
    justify-content: center;
}

.btn-primary {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-purple-hover);
}

.btn-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--status-online);
    color: var(--status-online);
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.25);
}

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

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

.btn-info {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.btn-info:hover {
    background: rgba(59, 130, 246, 0.25);
}

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

.btn-warning:hover {
    background: rgba(245, 158, 11, 0.25);
}

.btn-sm {
    padding: 4px 10px;
    font-size: var(--text-xs);
}

/* ========== Cards ========== */

.card {
    background: var(--glass-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
    border-color: rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.05);
}

.stat-card {
    background: var(--glass-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.06);
}

.stat-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-cards-grid.inv-cards {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 900px) {
    .stat-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== Tables ========== */

.table-container {
    background: var(--glass-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.data-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    background: var(--glass-card);
}

.data-table td {
    padding: 8px 12px;
    font-size: var(--text-sm);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--bg-elevated);
}

.data-table .empty-row td {
    color: var(--text-tertiary);
    text-align: center;
    padding: 8px 12px;
    font-size: var(--text-sm);
}

/* Profit colors — high specificity to override .data-table td */
.profit-positive, td.profit-positive, .data-table td.profit-positive { color: var(--profit-positive); font-weight: 600; }
.profit-negative, td.profit-negative, .data-table td.profit-negative { color: var(--profit-negative); font-weight: 600; }
.profit-neutral, td.profit-neutral, .data-table td.profit-neutral { color: var(--profit-neutral); }

/* ========== Account Cards ========== */

.account-card {
    background: linear-gradient(135deg, var(--glass-card) 0%, rgba(139, 92, 246, 0.03) 100%);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.account-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.account-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.account-name {
    font-size: var(--text-lg);
    font-weight: 600;
}

.account-balances {
    display: flex;
    gap: 16px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.account-balances-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.account-balance-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.05);
    transition: background 0.2s;
}

.account-balance-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 500;
}

.account-balance-value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.account-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
}

/* Online/Offline badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-xl);
    font-size: var(--text-xs);
    font-weight: 500;
}

.badge-online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-online);
}

.badge-offline {
    background: rgba(107, 114, 128, 0.15);
    color: var(--status-offline);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

.badge-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

/* ========== Toggle Switch ========== */

.toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 22px;
    transition: 0.2s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: 0.2s;
}

.toggle input:checked + .toggle-slider {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(18px);
    background: white;
}

/* ========== Forms ========== */

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-family: var(--font-family);
    transition: border-color 0.15s;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.form-section {
    margin-bottom: 24px;
}

.form-section-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* ========== Logs ========== */

.log-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.log-filters {
    display: flex;
    gap: 4px;
}

.log-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-search {
    width: 220px;
    height: 30px;
    font-size: var(--text-xs);
    padding: 4px 10px;
}

.logs-container {
    background: var(--glass-logs);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    line-height: 1;
    height: calc(100vh - 240px);
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-line {
    padding: 4px 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(63, 63, 70, 0.3);
    transition: background 0.1s;
}

.log-line:hover {
    background: rgba(139, 92, 246, 0.04);
}

.log-line:last-child {
    border-bottom: none;
}

.log-line.success {
    color: var(--status-online);
    border-left: 2px solid var(--status-online);
}

.log-line.error {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.04);
    border-left: 2px solid var(--accent-red);
}

.log-line.warning {
    color: var(--accent-yellow);
    border-left: 2px solid var(--accent-yellow);
}

.log-line.info {
    color: var(--text-secondary);
    border-left: 2px solid transparent;
}

.log-line.log-hidden {
    display: none;
}

.log-line .log-highlight {
    background: rgba(245, 158, 11, 0.3);
    border-radius: 2px;
    padding: 0 1px;
}

.log-autoscroll-active {
    background: rgba(139, 92, 246, 0.15) !important;
    border-color: var(--accent-purple) !important;
    color: var(--accent-purple) !important;
}

/* ========== Tabs ========== */

.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.tab-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.15s;
}

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

.tab-btn.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========== Page Header ========== */

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

.page-title {
    font-size: var(--text-2xl);
    font-weight: 700;
}

.page-actions {
    display: flex;
    gap: 8px;
}

/* ========== Toast Notifications ========== */

.toast-container {
    position: fixed;
    top: 64px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--glass-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: var(--text-sm);
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: toast-in 0.2s ease;
    max-width: 400px;
}

.toast.success { border-left: 3px solid var(--status-online); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.warning { border-left: 3px solid var(--accent-yellow); }
.toast.info { border-left: 3px solid var(--accent-blue); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ========== Loading ========== */

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ========== Skeleton Loaders ========== */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-elevated) 0%,
        var(--border-light) 50%,
        var(--bg-elevated) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-card {
    height: 120px;
}

.skeleton-stat-card {
    height: 80px;
}

.skeleton-table-row {
    height: 40px;
    margin-bottom: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== Page Transitions ========== */

.htmx-swapping {
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

.htmx-settling {
    opacity: 1;
    transition: opacity 0.15s ease-in;
}

.fade-in {
    animation: fade-in 0.2s ease-in;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Progress Bar ========== */

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-purple);
    transform-origin: left;
    z-index: 9999;
    animation: progress-bar 2s ease-in-out;
}

@keyframes progress-bar {
    0% { transform: scaleX(0); }
    50% { transform: scaleX(0.7); }
    100% { transform: scaleX(1); opacity: 0; }
}

.htmx-request.progress-indicator::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
    animation: progress-slide 1s ease-in-out infinite;
    z-index: 9999;
}

@keyframes progress-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========== Tooltip ========== */

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-primary);
    text-align: center;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: var(--text-xs);
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
}

.tooltip-content::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--border);
}

.tooltip:hover .tooltip-content,
.tooltip:focus .tooltip-content {
    visibility: visible;
    opacity: 1;
}

[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: var(--text-xs);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-tooltip]::after {
    content: "";
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--border);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ========== Smooth Animations ========== */

.animate-slide-up {
    animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-scale-in {
    animation: scale-in 0.2s ease-out;
}

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ========== Scrollbar ========== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ========== Misc ========== */

.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
/* ========== Brief Stats Cards ========== */

.brief-stats-cards {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.brief-stat-card {
    background: var(--glass-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.brief-stat-card:hover {
    border-color: rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.05);
}

.brief-stat-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 500;
}

.brief-stat-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.brief-stat-value small {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-tertiary);
}

@media (max-width: 1200px) {
    .brief-stats-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .brief-stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== Statistics Page ========== */

.stats-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 16px;
    min-height: 0;
}

@media (max-width: 1100px) {
    .stats-layout {
        grid-template-columns: 1fr;
    }
}

.stats-section {
    margin-bottom: 16px;
}

.stats-section-title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--accent-purple);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: var(--text-sm);
}

.stats-row-label {
    color: var(--text-secondary);
}

.stats-row-value {
    font-weight: 600;
    color: var(--text-primary);
}

.stats-total-row {
    background: var(--bg-elevated);
    font-weight: 700;
}

.stats-total-row td {
    border-bottom: 2px solid var(--accent-purple) !important;
}

/* ========== Filter Bar ========== */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.filter-btn.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

/* ========== Price Links ========== */

.price-link {
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}

.price-link:hover {
    color: var(--accent-cyan);
    text-decoration: underline;
}

/* ========== TM Sales ========== */

.sales-accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 16px;
}

.sales-account-card {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--glass-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sales-account-card:hover {
    border-color: rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.05);
}

.status-indicator {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.status-indicator.ok {
    background: rgba(16, 185, 129, 0.2);
    color: var(--status-online);
}

.status-indicator.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.sales-tables-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.sales-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    margin-bottom: 8px;
}

@media (max-width: 1200px) {
    .sales-tables-layout {
        grid-template-columns: 1fr;
    }
}

/* ========== Inventory Tabs ========== */

.inv-tab {
    padding: 8px 20px;
    border: none;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: all 0.15s;
}

.inv-tab:hover {
    color: var(--text-primary);
}

.inv-tab.active {
    background: var(--accent-purple);
    color: white;
}

/* ========== Parser Table ========== */

.parser-table td {
    font-size: var(--text-base);
    padding: 10px 16px;
    white-space: nowrap;
}

.parser-table th {
    padding: 10px 16px;
    font-size: var(--text-sm);
}

.parser-table td:first-child {
    white-space: normal;
    word-break: break-word;
}

/* ========== Dropdown ========== */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    min-width: 220px;
    background: var(--glass-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 100;
    padding: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: var(--text-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.1s;
}

.dropdown-item:hover {
    background: var(--bg-elevated);
}

.dropdown-item input[type="checkbox"] {
    accent-color: var(--accent-purple);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.dropdown-item span:first-of-type {
    flex: 1;
}

.dropdown-footer {
    padding: 8px 12px 4px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.font-mono { font-family: var(--font-mono); }

/* ========== Light Theme Overrides ========== */

[data-theme="light"] .app-header {
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .sidebar {
    border-right: 1px solid var(--border);
}

[data-theme="light"] .sidebar-logo-text {
    background: linear-gradient(135deg, #7c3aed 0%, #0891b2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .nav-item:hover {
    background: rgba(124, 58, 237, 0.07);
}

[data-theme="light"] .status-bar {
    border-top: 1px solid var(--border);
}

[data-theme="light"] .content-area {
    background:
        radial-gradient(ellipse 55% 65% at 0% 0%, rgba(124, 58, 237, 0.1), transparent),
        radial-gradient(ellipse 45% 55% at 100% 100%, rgba(8, 145, 178, 0.08), transparent),
        radial-gradient(ellipse 40% 45% at 60% 15%, rgba(37, 99, 235, 0.06), transparent),
        radial-gradient(ellipse 35% 40% at 80% 50%, rgba(236, 72, 153, 0.04), transparent),
        linear-gradient(135deg, rgba(124, 58, 237, 0.02) 0%, rgba(8, 145, 178, 0.02) 100%),
        var(--bg-primary);
    background-attachment: fixed;
}

[data-theme="light"] .card {
    box-shadow: var(--shadow-card);
}

[data-theme="light"] .card:hover {
    border-color: rgba(124, 58, 237, 0.25);
    box-shadow: 0 2px 16px rgba(124, 58, 237, 0.08);
}

[data-theme="light"] .stat-card {
    box-shadow: var(--shadow-card);
}

[data-theme="light"] .stat-card:hover {
    border-color: rgba(124, 58, 237, 0.25);
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.08);
}

[data-theme="light"] .account-card {
    box-shadow: var(--shadow-card);
}

[data-theme="light"] .account-card:hover {
    border-color: rgba(124, 58, 237, 0.25);
    box-shadow: 0 2px 16px rgba(124, 58, 237, 0.08);
}

[data-theme="light"] .nav-item.active {
    background: rgba(124, 58, 237, 0.08);
    box-shadow: none;
}

[data-theme="light"] .toast {
    box-shadow: var(--shadow-toast);
    border-color: var(--border);
}

[data-theme="light"] .dropdown-menu {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-dropdown);
}

[data-theme="light"] .log-line {
    border-bottom-color: var(--border-light);
}

[data-theme="light"] .log-line:hover {
    background: rgba(124, 58, 237, 0.04);
}

[data-theme="light"] .log-line.error {
    background: rgba(220, 38, 38, 0.05);
}

[data-theme="light"] .sales-account-card {
    box-shadow: var(--shadow-card);
}

[data-theme="light"] .sales-account-card:hover {
    border-color: rgba(124, 58, 237, 0.25);
    box-shadow: 0 2px 16px rgba(124, 58, 237, 0.08);
}

[data-theme="light"] .btn-success {
    background: rgba(5, 150, 105, 0.1);
}

[data-theme="light"] .btn-success:hover {
    background: rgba(5, 150, 105, 0.18);
}

[data-theme="light"] .btn-danger {
    background: rgba(220, 38, 38, 0.08);
}

[data-theme="light"] .btn-danger:hover {
    background: rgba(220, 38, 38, 0.15);
}

[data-theme="light"] .btn-info {
    background: rgba(37, 99, 235, 0.08);
}

[data-theme="light"] .btn-info:hover {
    background: rgba(37, 99, 235, 0.15);
}

[data-theme="light"] .btn-warning {
    background: rgba(217, 119, 6, 0.08);
}

[data-theme="light"] .btn-warning:hover {
    background: rgba(217, 119, 6, 0.15);
}

[data-theme="light"] .badge-online {
    background: rgba(5, 150, 105, 0.1);
}

[data-theme="light"] .badge-offline {
    background: rgba(156, 163, 175, 0.12);
}

[data-theme="light"] .badge-warning {
    background: rgba(217, 119, 6, 0.1);
}

[data-theme="light"] .badge-error {
    background: rgba(220, 38, 38, 0.08);
}

[data-theme="light"] .status-badge.running {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.3);
}

[data-theme="light"] .status-badge.stopped {
    background: rgba(156, 163, 175, 0.12);
    border-color: rgba(156, 163, 175, 0.3);
}

[data-theme="light"] .status-indicator.ok {
    background: rgba(5, 150, 105, 0.12);
}

[data-theme="light"] .status-indicator.error {
    background: rgba(220, 38, 38, 0.1);
}

[data-theme="light"] .table-container {
    box-shadow: var(--shadow-card);
}

[data-theme="light"] .brief-stat-card {
    box-shadow: var(--shadow-card);
}

[data-theme="light"] .brief-stat-card:hover {
    border-color: rgba(124, 58, 237, 0.25);
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.08);
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: var(--bg-elevated);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #bbbbc8;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #a0a0b0;
}

[data-theme="light"] .tooltip-content,
[data-theme="light"] [data-tooltip]::before {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-elevated) 0%,
        var(--border) 50%,
        var(--bg-elevated) 100%
    );
}

/* ========== Mobile Menu Toggle ========== */

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 19;
}

.sidebar-overlay.active {
    display: block;
}

/* ========== Responsive — Tablet (< 1024px) ========== */

@media (max-width: 1024px) {
    .brief-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sales-tables-layout {
        grid-template-columns: 1fr;
    }

    .accounts-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

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

/* ========== Responsive — Mobile (< 768px) ========== */

@media (max-width: 768px) {
    html, body {
        overflow: auto;
    }

    .mobile-menu-btn {
        display: block;
    }

    /* --- Header --- */
    .app-header {
        padding: 0 10px;
        height: 48px;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .app-title {
        font-size: var(--text-lg);
    }

    #header-status .status-badge {
        font-size: 10px;
        padding: 2px 8px;
    }

    .header-actions {
        gap: 4px;
        flex-wrap: nowrap;
        overflow: hidden;
    }

    /* Hide all action buttons on mobile except theme and logout */
    #start-dropdown-wrapper,
    .header-actions .btn[data-tooltip="Stop trading bot"],
    .header-actions .btn[data-tooltip="Sync market orders"],
    .header-actions .btn[data-tooltip="Sync Steam inventory"],
    .header-actions .btn[data-tooltip="Refresh all data"] {
        display: none;
    }

    .header-actions .btn:not(.btn-icon) {
        width: auto;
        height: 34px;
        padding: 0 10px;
        font-size: var(--text-xs);
    }

    .header-actions .btn-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    /* --- Layout --- */
    .app-layout {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 48px - 28px);
        overflow: visible;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 48px;
        bottom: 28px;
        width: 240px;
        min-width: 240px;
        z-index: 20;
        transition: left 0.25s ease;
        border-right: 1px solid var(--border);
        background: var(--glass-bg-sidebar);
        backdrop-filter: blur(16px);
    }

    .sidebar.open {
        left: 0;
    }

    .content-area {
        padding: 10px;
        overflow-y: auto;
        min-height: calc(100vh - 48px - 28px);
    }

    /* --- Stat Cards --- */
    .stat-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

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

    .stat-card {
        padding: 10px;
    }

    .stat-card-title {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .stat-card-value {
        font-size: var(--text-lg);
    }

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

    .brief-stat-card {
        padding: 10px 12px;
    }

    .brief-stat-label {
        font-size: 10px;
    }

    .brief-stat-value {
        font-size: var(--text-lg);
    }

    .flex.gap-4 {
        flex-direction: column;
    }

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

    /* --- Accounts --- */
    .accounts-grid {
        grid-template-columns: 1fr;
    }

    .account-card {
        padding: 12px;
    }

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

    .account-actions {
        flex-wrap: wrap;
    }

    .account-actions .btn {
        flex: 1;
        min-width: 0;
    }

    .sales-accounts-grid {
        grid-template-columns: 1fr;
    }

    /* --- Forms --- */
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-section-title {
        font-size: var(--text-base);
    }

    /* --- Page Header --- */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .page-title {
        font-size: var(--text-xl);
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1;
    }

    /* --- Tables --- */
    .table-container {
        border-radius: var(--radius-md);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 500px;
    }

    .data-table td, .data-table th {
        padding: 8px 10px;
        font-size: var(--text-xs);
        white-space: nowrap;
    }

    .data-table .empty-row td {
        white-space: normal;
    }

    .sales-tables-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* --- Logs --- */
    .log-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .log-filters {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .log-search {
        width: 100%;
    }

    .logs-container {
        height: calc(100vh - 280px);
    }

    /* --- Toast --- */
    .toast-container {
        left: 10px;
        right: 10px;
        top: 52px;
    }

    .toast {
        max-width: 100%;
        font-size: var(--text-xs);
        padding: 8px 12px;
    }

    /* --- Dropdown --- */
    .dropdown-menu {
        position: fixed;
        left: 10px;
        right: 10px;
        top: 52px;
        min-width: auto;
    }

    /* --- Status Bar --- */
    .status-bar {
        height: 28px;
        padding: 0 10px;
        font-size: 10px;
    }

    /* --- Statistics --- */
    .stats-layout {
        grid-template-columns: 1fr;
    }

    /* --- Filters --- */
    .filter-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .filter-btn {
        flex-shrink: 0;
    }

    /* --- Tabs --- */
    .tab-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        flex-shrink: 0;
        padding: 8px 12px;
    }

    /* --- Inventory Grid --- */
    .inventory-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
    }

    .item-info {
        padding: 8px;
    }

    .item-name {
        font-size: var(--text-xs);
    }

    /* --- Timeline --- */
    .timeline {
        padding: 12px;
        gap: 12px;
    }

    .timeline-event {
        flex-direction: column;
        padding: 12px;
    }

    .timeline-icon {
        align-self: flex-start;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .timeline-title {
        font-size: var(--text-sm);
    }

    /* --- Parser table --- */
    .parser-table td {
        font-size: var(--text-xs);
        padding: 8px 10px;
    }

    .parser-table th {
        padding: 8px 10px;
        font-size: 11px;
    }
}

/* ========== Activity Timeline ========== */
.timeline-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.timeline-container {
    margin-top: 16px;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
}

.timeline-event {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--glass-card);
    border-left: 3px solid var(--accent-purple);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.timeline-event:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.15);
}

.timeline-event[data-event-type="purchase"] {
    border-left-color: var(--status-online);
}

.timeline-event[data-event-type="sale"] {
    border-left-color: var(--accent-cyan);
}

.timeline-event[data-event-type="error"] {
    border-left-color: var(--status-error);
}

.timeline-event[data-event-type="login"] {
    border-left-color: var(--accent-purple);
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.timeline-icon-success {
    background: rgba(16, 185, 129, 0.15);
}

.timeline-icon-error {
    background: rgba(239, 68, 68, 0.15);
}

.timeline-icon-warning {
    background: rgba(251, 191, 36, 0.15);
}

.timeline-icon-info {
    background: rgba(59, 130, 246, 0.15);
}

.timeline-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-title {
    font-weight: 600;
    font-size: var(--text-base);
}

.timeline-time {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.timeline-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.timeline-account {
    font-size: var(--text-xs);
}

.timeline-details {
    margin-top: 4px;
}

.timeline-details summary {
    cursor: pointer;
    color: var(--accent-cyan);
    font-size: var(--text-xs);
    user-select: none;
    list-style: none;
}

.timeline-details summary:hover {
    text-decoration: underline;
}

.timeline-metadata {
    margin-top: 8px;
    padding: 12px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-tertiary);
}

/* ========== Inventory Grid View ========== */
.view-toggle {
    display: flex;
    gap: 4px;
}

.btn-icon {
    padding: 8px 12px;
    font-size: 16px;
}

.btn-icon.active {
    background: var(--accent-purple);
    color: white;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px;
}

.inventory-item-card {
    background: var(--glass-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.inventory-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
    border-color: var(--accent-purple);
}

.item-image-container {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(6, 182, 212, 0.05));
    overflow: hidden;
}

.item-image-container img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.item-float-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.item-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-name {
    font-size: var(--text-sm);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-account {
    font-size: var(--text-xs);
}

.item-prices {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
}

.item-buy-price {
    color: var(--text-secondary);
}

.item-profit {
    font-weight: 600;
}

.item-status {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* ========== Mobile responsive adjustments ========== */
@media (max-width: 768px) {
    .timeline-event {
        flex-direction: column;
    }

    .timeline-icon {
        align-self: flex-start;
    }

    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
}
