@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;700&family=Sora:wght@300;400;500;600;700&display=swap");

:root {
    --font-body: "Sora", "Segoe UI", sans-serif;
    --font-title: "Fraunces", "Times New Roman", serif;
    --bg: #0c111b;
    --bg-soft: #101826;
    --bg-elevated: #151f31;
    --card: #1a2438;
    --text: #f3f6ff;
    --text-muted: #9aa6bf;
    --accent: #e05252;
    --accent-strong: #c73f3f;
    --accent-glow: rgba(224, 82, 82, 0.35);
    --accent-soft: rgba(224, 82, 82, 0.18);
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 24px 60px rgba(7, 12, 20, 0.5);
    --glass-bg: rgba(16, 24, 38, 0.72);
    --glass-border: rgba(255, 255, 255, 0.06);
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.15);
    --chart-bg: #1a2438;
    --chart-text: #9aa6bf;
}

body[data-theme="light"] {
    --bg: #f2f4f8;
    --bg-soft: #e7ecf3;
    --bg-elevated: #ffffff;
    --card: #ffffff;
    --text: #101623;
    --text-muted: #5b677b;
    --accent: #d24c4c;
    --accent-strong: #b23e3e;
    --accent-glow: rgba(210, 76, 76, 0.22);
    --accent-soft: rgba(210, 76, 76, 0.14);
    --border: rgba(10, 20, 30, 0.12);
    --shadow: 0 24px 60px rgba(15, 25, 40, 0.15);
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(10, 20, 30, 0.08);
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --chart-bg: #ffffff;
    --chart-text: #5b677b;
}

/* ── Global Smooth Theme Transition ── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body,
body *:not(.history-chart):not(svg):not(svg *) {
    transition: background-color 0.4s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
    padding-right: var(--scrollbar-width, 0);
}

/* ── Background Effects ── */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 0);
    background-size: 42px 42px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

body[data-theme="light"] .bg-grid {
    background-image: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.06) 1px, transparent 0);
    opacity: 0.2;
}

.bg-orbit {
    position: fixed;
    inset: -10%;
    background: radial-gradient(circle at 75% 25%, rgba(224, 82, 82, 0.15), transparent 50%),
        radial-gradient(circle at 25% 60%, rgba(96, 129, 255, 0.15), transparent 50%);
    filter: blur(0);
    pointer-events: none;
    z-index: 0;
}

body[data-theme="light"] .bg-orbit {
    background: radial-gradient(circle at 75% 25%, rgba(224, 82, 82, 0.08), transparent 50%),
        radial-gradient(circle at 25% 60%, rgba(96, 129, 255, 0.08), transparent 50%);
}

body[data-theme="light"] .topbar {
    background: linear-gradient(135deg, rgba(224, 82, 82, 0.08), rgba(96, 129, 255, 0.06)), var(--glass-bg);
    box-shadow: 0 4px 30px rgba(15, 25, 40, 0.08), 0 2px 0 rgba(224, 82, 82, 0.05) inset;
}

body[data-theme="light"] .catalog-panel {
    background: linear-gradient(135deg, rgba(224, 82, 82, 0.04), rgba(96, 129, 255, 0.03)), var(--bg-soft);
    box-shadow: var(--shadow), 0 0 40px rgba(96, 129, 255, 0.06) inset;
}

/* ── Glassmorphism Sticky Topbar ── */
.topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding: 14px 5vw;
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, rgba(224, 82, 82, 0.12), rgba(96, 129, 255, 0.08)), var(--glass-bg);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12), 0 2px 0 rgba(224, 82, 82, 0.08) inset;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 6px 18px rgba(20, 40, 60, 0.25);
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.08) rotate(-2deg);
    box-shadow: 0 8px 24px rgba(224, 82, 82, 0.2);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.4px;
    background: linear-gradient(135deg, var(--text), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-subtitle {
    color: var(--text-muted);
    font-size: 10.5px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    opacity: 0.7;
    font-weight: 400;
}

/* ── Enhanced Search Bar ── */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 16px;
    min-height: 44px;
    max-width: 420px;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-bar::before {
    content: "";
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-right: 10px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa6bf' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.search-bar input {
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    width: 100%;
    font-size: 13.5px;
    font-family: var(--font-body);
}

.search-bar input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.search-hint {
    font-size: 10.5px;
    color: var(--text-muted);
    background: var(--bg-soft);
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    white-space: nowrap;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.search-bar.is-active {
    border-color: rgba(224, 82, 82, 0.5);
    box-shadow: 0 0 0 4px var(--accent-soft), 0 8px 32px rgba(224, 82, 82, 0.06);
    transform: translateY(-1px);
    max-width: 600px;
}

.search-bar.is-active::before {
    opacity: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Theme Toggle ── */
.theme-toggle {
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    padding: 9px 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    letter-spacing: 0.4px;
    transition: all 0.25s ease;
    font-family: var(--font-body);
}

.theme-toggle:hover {
    border-color: rgba(224, 82, 82, 0.3);
    background: var(--accent-soft);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(224, 82, 82, 0.1);
}

.theme-toggle:active {
    transform: translateY(0) scale(0.97);
}

.theme-icon {
    font-size: 16px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(180deg);
}

/* ── Main Content ── */
.catalog-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 20px 5vw 5vw;
    position: relative;
    z-index: 1;
}

.catalog-panel {
    background: linear-gradient(135deg, rgba(224, 82, 82, 0.06), rgba(96, 129, 255, 0.04)), var(--bg-soft);
    border-radius: 24px;
    padding: 28px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow), 0 0 60px rgba(224, 82, 82, 0.08) inset;
    display: flex;
    flex-direction: column;
    min-height: 70vh;
    animation: panelFadeIn 0.5s ease;
}

@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-header h1 {
    margin: 0 0 6px;
    font-family: var(--font-title);
    font-size: 26px;
    font-weight: 600;
}

.panel-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* ── Tab Switch ── */
.tab-switch {
    display: flex;
    background: var(--bg-elevated);
    border-radius: 999px;
    padding: 4px;
    border: 1px solid var(--border);
}

.tab-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 9px 22px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.25s ease;
    font-family: var(--font-body);
}

.tab-btn:hover:not(.is-active) {
    color: var(--text);
    background: rgba(224, 82, 82, 0.06);
}

.tab-btn.is-active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 3px 14px rgba(224, 82, 82, 0.3);
}

/* ── Control Group ── */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-size: 10.5px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 500;
}

.control-group select,
.control-group input {
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-soft));
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 14px;
    border-radius: 12px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--font-body);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    appearance: none;
    background-image: linear-gradient(135deg, var(--bg-elevated), var(--bg-soft)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e05252' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, right 12px center;
    padding-right: 32px;
}

.control-group input {
    background-image: none;
    padding-right: 14px;
}

.control-group select:hover,
.control-group input:hover {
    border-color: rgba(224, 82, 82, 0.35);
    box-shadow: 0 4px 16px rgba(224, 82, 82, 0.12);
    transform: translateY(-1px);
}

.control-group select:focus,
.control-group input:focus {
    border-color: rgba(224, 82, 82, 0.5);
    box-shadow: 0 0 0 3px var(--accent-soft), 0 4px 16px rgba(224, 82, 82, 0.15);
    transform: translateY(-1px);
}

.control-group.compact {
    min-width: 200px;
}

/* ── List Header ── */
.list-header {
    margin: 16px 0 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 12px;
}

#listCount {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.3px;
}

/* ── Table ── */
.table-wrap {
    margin-top: 8px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    overflow: hidden;
    flex: 1;
}

.catalog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.catalog-table thead {
    background: var(--bg-soft);
}

.catalog-table th {
    text-align: left;
    padding: 13px 16px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    position: relative;
}

.catalog-table th::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
}

.catalog-table th:nth-child(1) { width: 140px; }
.catalog-table th:nth-child(3) { width: 190px; }
.catalog-table th:nth-child(4) { width: 90px; }
.catalog-table th:nth-child(5) { width: 120px; text-align: right; }
.catalog-table th:nth-child(6) { width: 110px; }

.catalog-table td {
    padding: 13px 16px;
    border-top: 1px solid var(--border);
    vertical-align: top;
}

/* ── Row Animations ── */
.catalog-row {
    cursor: pointer;
    transition: all 0.2s ease;
    animation: rowSlideIn 0.3s ease both;
}

.catalog-row:nth-child(1)  { animation-delay: 0.02s; }
.catalog-row:nth-child(2)  { animation-delay: 0.04s; }
.catalog-row:nth-child(3)  { animation-delay: 0.06s; }
.catalog-row:nth-child(4)  { animation-delay: 0.08s; }
.catalog-row:nth-child(5)  { animation-delay: 0.10s; }
.catalog-row:nth-child(6)  { animation-delay: 0.12s; }
.catalog-row:nth-child(7)  { animation-delay: 0.14s; }
.catalog-row:nth-child(8)  { animation-delay: 0.16s; }
.catalog-row:nth-child(9)  { animation-delay: 0.18s; }
.catalog-row:nth-child(10) { animation-delay: 0.20s; }
.catalog-row:nth-child(n+11) { animation-delay: 0.22s; }

@keyframes rowSlideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}

.catalog-row:hover {
    background: rgba(224, 82, 82, 0.05);
    transform: translateX(2px);
}

.catalog-row:active {
    transform: translateX(1px) scale(0.999);
}

/* ── Poz Chip ── */
.poz-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
}

.poz-chip:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(224, 82, 82, 0.25);
}

.poz-chip:active {
    transform: translateY(0) scale(0.96);
}

.cell-muted {
    color: var(--text-muted);
    font-size: 12px;
}

.price-cell {
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.align-right {
    text-align: right;
}

/* ── Enhanced Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 16px;
    gap: 8px;
}

.page-btn {
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    padding: 9px 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(224, 82, 82, 0.1);
}

.page-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.97);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#pageInfo {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    background: var(--bg-elevated);
    padding: 6px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    min-width: 80px;
    text-align: center;
}

/* ── Skeleton Loading ── */
.skeleton-row td {
    position: relative;
    overflow: hidden;
}

.skeleton-bar {
    display: block;
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--border) 25%, rgba(224, 82, 82, 0.06) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.6s ease-in-out infinite;
}

.skeleton-bar.w-xs  { width: 40px; }
.skeleton-bar.w-sm  { width: 65px; }
.skeleton-bar.w-md  { width: 120px; }
.skeleton-bar.w-lg  { width: 200px; }
.skeleton-bar.w-xl  { width: 280px; }

@keyframes skeletonShimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ── Info Panel ── */
.info-panel {
    display: grid;
    gap: 16px;
}

.info-card {
    background: var(--bg-soft);
    border-radius: 20px;
    padding: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.info-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
}

.info-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* ── Modal with Animations ── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 18, 0.01);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 10000010;
}

.modal-backdrop.is-open {
    display: flex;
    background: rgba(6, 10, 18, 0.68);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: backdropIn 0.3s ease forwards;
}

@keyframes backdropIn {
    from { background: rgba(6, 10, 18, 0.01); backdrop-filter: blur(0); }
    to   { background: rgba(6, 10, 18, 0.68); backdrop-filter: blur(8px); }
}

body[data-theme="light"] .modal-backdrop.is-open {
    background: rgba(15, 25, 40, 0.38);
}

.modal {
    width: min(920px, 100%);
    max-height: 85vh;
    background: var(--bg-elevated);
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 22px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: linear-gradient(180deg, rgba(224, 82, 82, 0.04), transparent);
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-family: var(--font-title);
    font-size: 22px;
}

.modal-header p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 12px;
    max-width: 520px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-close {
    border: none;
    background: var(--bg-soft);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--accent);
    color: #fff;
    transform: rotate(90deg);
    box-shadow: 0 4px 14px rgba(224, 82, 82, 0.25);
}

/* ── Copy Poz Description Button ── */
.copy-poz-desc-btn {
    border: none;
    background: var(--bg-soft);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.copy-poz-desc-btn:hover {
    background: var(--success-soft);
    color: var(--success);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(52, 211, 153, 0.2);
}

.copy-poz-desc-btn:active {
    transform: scale(0.95);
}

/* ── Platform Button ── */
.platform-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #e05252, #c73e3e);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(224, 82, 82, 0.3);
    position: relative;
    overflow: hidden;
    animation: platformPulse 2s ease-in-out infinite;
}

.platform-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.platform-btn:hover::before {
    width: 300px;
    height: 300px;
}

.platform-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(224, 82, 82, 0.4);
    animation: none;
}

.platform-btn svg {
    position: relative;
    z-index: 1;
}

.platform-btn span {
    position: relative;
    z-index: 1;
}

.platform-btn-modal {
    padding: 8px 14px;
    font-size: 11px;
}

@keyframes platformPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(224, 82, 82, 0.3), 0 0 0 0 rgba(224, 82, 82, 0.4);
    }
    50% {
        box-shadow: 0 4px 12px rgba(224, 82, 82, 0.3), 0 0 0 8px rgba(224, 82, 82, 0);
    }
}

.modal-body {
    padding: 24px 28px 28px;
    overflow: auto;
}

.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.modal-body::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Detail Grid Cards ── */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.detail-card {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.detail-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.detail-card:hover {
    border-color: rgba(224, 82, 82, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(224, 82, 82, 0.06);
}

.detail-card:hover::before {
    opacity: 1;
}

.detail-card span {
    display: block;
    font-size: 10.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.detail-card strong {
    font-size: 15px;
    margin-top: 6px;
    display: block;
    color: var(--text);
}

/* ── Detail Table ── */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.detail-table th,
.detail-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.detail-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-soft);
}

.detail-table tbody tr {
    transition: background 0.15s ease;
}

.detail-table tbody tr:hover {
    background: rgba(224, 82, 82, 0.04);
}

.detail-table tbody tr:last-child td {
    border-bottom: none;
}

/* ── History Card ── */
.history-card {
    margin-top: 20px;
    padding: 20px;
    border-radius: 18px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.history-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-title::before {
    content: "📈";
    font-size: 15px;
}

.history-meta {
    color: var(--text-muted);
    font-size: 12px;
    margin: 0 0 14px;
}

.history-chart {
    width: 100%;
    height: 220px;
    display: block;
    border-radius: 12px;
    overflow: hidden;
}

.history-empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: 12px 0;
    text-align: center;
    font-style: italic;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
    font-size: 12px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.history-table th,
.history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.history-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 10.5px;
    background: var(--bg-elevated);
}

.history-table tbody tr {
    transition: background 0.15s ease;
}

.history-table tbody tr:hover {
    background: rgba(224, 82, 82, 0.04);
}

.history-table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Toast Notification ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000020;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-left: 3px solid var(--success);
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 13px;
    color: var(--text);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1), toastOut 0.3s ease 2.2s forwards;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(12px);
    font-family: var(--font-body);
}

.toast-icon {
    font-size: 15px;
    flex-shrink: 0;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.92); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}

/* ── Animations ── */
@keyframes searchPulse {
    0%   { box-shadow: 0 0 0 0 var(--accent-soft); }
    70%  { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── Empty State ── */
.empty-state {
    padding: 40px 30px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 1100px) {
    .topbar {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px 4vw;
    }
    .catalog-shell {
        grid-template-columns: 1fr;
        padding: 16px 4vw 4vw;
    }
}

@media (max-width: 720px) {
    .topbar {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 8px;
        padding: 10px 16px;
    }
    .brand-subtitle {
        display: none;
    }
    .search-hint {
        display: none;
    }
    .catalog-panel {
        padding: 16px;
        border-radius: 18px;
    }
    .panel-header {
        flex-direction: column;
        gap: 12px;
    }
    .panel-header h1 {
        font-size: 22px;
    }
    .modal {
        border-radius: 18px;
        margin: 8px;
    }
    .modal-header {
        padding: 16px 20px;
    }
    .modal-body {
        padding: 16px 20px 20px;
    }
    .detail-grid {
        grid-template-columns: 1fr 1fr;
    }
    .toast-container {
        bottom: 12px;
        right: 12px;
        left: 12px;
    }
}
