@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300..800;1,300..800&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
    --bg: #09090b;
    --surface: rgba(24, 24, 27, 0.45);
    --surface-hover: rgba(39, 39, 42, 0.6);
    --surface2: rgba(39, 39, 42, 0.4);
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);

    --text: #ffffff;
    --text2: #a1a1aa;
    --text3: #71717a;

    --red: #ff3366;
    --red-bg: rgba(255, 51, 102, 0.1);
    --red-border: rgba(255, 51, 102, 0.25);
    --orange: #ff9f1c;
    --orange-bg: rgba(255, 159, 28, 0.1);
    --orange-border: rgba(255, 159, 28, 0.25);
    --green: #00e699;
    --green-bg: rgba(0, 230, 153, 0.1);
    --green-border: rgba(0, 230, 153, 0.25);
    --blue: #3399ff;
    --blue-bg: rgba(51, 153, 255, 0.1);
    --blue-border: rgba(51, 153, 255, 0.25);
    --brown: #d4a373;
    --brown-bg: rgba(212, 163, 115, 0.1);
    --brown-border: rgba(212, 163, 115, 0.25);
    --gray: #9ca3af;
    --gray-bg: rgba(156, 163, 175, 0.1);
    --gray-border: rgba(156, 163, 175, 0.25);
    --purple: #bf5bfa;
    --purple-bg: rgba(191, 91, 250, 0.1);
    --purple-border: rgba(191, 91, 250, 0.25);
    --pink: #ff4db8;
    --pink-bg: rgba(255, 77, 184, 0.1);
    --pink-border: rgba(255, 77, 184, 0.25);
}

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

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 15% 30%, rgba(51, 153, 255, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 70%, rgba(191, 91, 250, 0.08) 0%, transparent 45%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* === NAV === */
nav {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 32px;
    border-bottom: 1px solid var(--border);
    background: rgba(9, 9, 11, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.nav-brand {
    font-size: 16px;
    font-weight: 800;
    padding: 16px 24px 16px 0;
    border-right: 1px solid var(--border);
    margin-right: 8px;
    letter-spacing: -0.4px;
    white-space: nowrap;
    background: linear-gradient(135deg, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-brand span {
    color: var(--text3);
    font-weight: 400;
    margin-left: 6px;
    -webkit-text-fill-color: var(--text3);
}

.nav-link {
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text2);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

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

.nav-link.active {
    color: var(--text);
    border-bottom-color: var(--blue);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background: var(--blue);
    filter: blur(20px);
    z-index: -1;
    opacity: 0.5;
}

.nav-meta {
    margin-left: auto;
    font-size: 12px;
    color: var(--text3);
    white-space: nowrap;
    background: var(--surface2);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.nav-meta strong {
    color: var(--text);
    font-weight: 600;
}

/* === COMMON === */
.page {
    padding: 32px 40px 64px;
    max-width: 1600px;
    margin: 0 auto;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 28px;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Base Glassmorphism properties applied to cards, panels, etc */
.glass,
.panel,
.card,
.health {
    background: var(--surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

/* Cards row */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s, background 0.25s;
}

.card:hover {
    transform: translateY(-2px);
    background: var(--surface-hover);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: height 0.2s;
}

.card:hover::before {
    height: 6px;
}

.card .count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 0 20px currentColor;
    /* glow effect */
}

.card .label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text2);
}

.card .sub {
    font-size: 12px;
    color: var(--text3);
    margin-top: 8px;
    font-weight: 500;
}

/* Health score */
.health {
    padding: 32px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 48px;
    flex-wrap: wrap;
}

.health-score {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.03), inset 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.health-score::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    z-index: -1;
    filter: blur(20px);
    opacity: 0.3;
}

.health-score .number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 0 15px currentColor;
}

.health-score .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
    font-weight: 700;
}

.health-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 32px;
    flex: 1;
}

.health-metric {
    position: relative;
}

.health-metric label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text2);
    display: block;
    margin-bottom: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.health-metric .val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.health-metric .note {
    font-size: 13px;
    color: var(--text3);
    margin-top: 4px;
    font-weight: 500;
}

/* Panels */
.panel {
    overflow: hidden;
    margin-bottom: 24px;
}

.panel-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    background: rgba(0, 0, 0, 0.1);
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.panel-header .sub {
    font-size: 13px;
    color: var(--text3);
    font-weight: 500;
    transition: color 0.2s;
}

.panel-header .sub:hover {
    color: var(--text);
}

.panel-list {
    max-height: 500px;
    overflow-y: auto;
}

/* Scrollbar styling for sleek modern look */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.badge-zero {
    background: var(--gray-bg);
    color: var(--gray);
    border: 1px solid var(--gray-border);
    text-shadow: 0 0 8px rgba(156, 163, 175, 0.3);
}

.badge-critical {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red-border);
    text-shadow: 0 0 8px rgba(255, 51, 102, 0.4);
}

.badge-warning {
    background: var(--orange-bg);
    color: var(--orange);
    border: 1px solid var(--orange-border);
    text-shadow: 0 0 8px rgba(255, 159, 28, 0.4);
}

.badge-ok {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-border);
    text-shadow: 0 0 8px rgba(0, 230, 153, 0.4);
}

.badge-moderate {
    background: var(--blue-bg);
    color: var(--blue);
    border: 1px solid var(--blue-border);
    text-shadow: 0 0 8px rgba(51, 153, 255, 0.4);
}

.badge-overstock {
    background: var(--brown-bg);
    color: var(--brown);
    border: 1px solid var(--brown-border);
    text-shadow: 0 0 8px rgba(212, 163, 115, 0.4);
}

.badge-promo {
    background: var(--pink-bg);
    color: var(--pink);
    border: 1px solid var(--pink-border);
    text-shadow: 0 0 8px rgba(255, 77, 184, 0.4);
}

.badge-bundle {
    background: var(--purple-bg);
    color: var(--purple);
    border: 1px solid var(--purple-border);
    text-shadow: 0 0 8px rgba(191, 91, 250, 0.4);
}

.urgency-tag {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.urgency-now {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red-border);
    box-shadow: 0 0 12px rgba(255, 51, 102, 0.2);
}

.urgency-soon {
    background: var(--orange-bg);
    color: var(--orange);
    border: 1px solid var(--orange-border);
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

thead th {
    text-align: left;
    padding: 16px 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

tbody tr {
    transition: background 0.2s, transform 0.1s;
    position: relative;
}

tbody tr:hover {
    background: var(--surface-hover);
    z-index: 1;
}

/* Add a very subtle border bottom for rows */
tbody td {
    padding: 14px 20px;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

tbody tr:last-child td {
    border-bottom: none;
}

.td-name {
    white-space: normal;
    max-width: 380px;
    font-weight: 600;
    line-height: 1.4;
}

.td-right {
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 500;
}

/* Search Elements */
.search-box {
    position: relative;
    max-width: 440px;
    margin-bottom: 24px;
}

.search-box input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px 14px 44px;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-box input:focus {
    border-color: var(--blue);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(51, 153, 255, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-box input::placeholder {
    color: var(--text3);
}

.search-box svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
    width: 18px;
    height: 18px;
    transition: color 0.2s;
}

.search-box input:focus+svg {
    color: var(--blue);
}

/* Sort buttons */
.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.cat-card-off {
    opacity: 0.55;
}

.cat-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text2);
    user-select: none;
    cursor: pointer;
}

.cat-check input {
    accent-color: var(--blue);
    cursor: pointer;
}

.cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
}

.sort-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 18px;
    color: var(--text2);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sort-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-light);
    color: var(--text);
}

.sort-btn.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text2);
    color: var(--text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-count {
    font-size: 14px;
    color: var(--text3);
    margin-left: auto;
    font-weight: 500;
}

/* Detail row */
.detail-row td {
    padding: 0 !important;
    border-bottom: none;
}

.detail-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.15);
}

.detail-row.open .detail-content {
    max-height: 500px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.detail-inner {
    padding: 24px;
    display: grid;
    grid-template-columns: 88px repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    margin: 0 24px 24px;
    border-left: 4px solid var(--border);
    border-radius: 0 0 12px 12px;
    background: var(--surface2);
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.2);
}

.detail-photo {
    grid-row: 1 / 3;
    width: 88px;
    height: 88px;
    border-radius: 12px;
    object-fit: contain;
    background: #fff;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.detail-item label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text3);
    margin-bottom: 6px;
}

.detail-item .val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 700;
}

.detail-item .note {
    font-size: 13px;
    color: var(--text3);
    margin-top: 4px;
    font-weight: 500;
}

/* Recommendation boxes */
.rec-box {
    grid-column: 1 / -1;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
}

.rec-box strong {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.rec-order {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    text-shadow: 0 0 12px rgba(255, 51, 102, 0.2);
}

.rec-order strong {
    color: var(--red);
    text-shadow: none;
}

.rec-order .rec-highlight {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 800;
    color: var(--red);
}

.rec-warn {
    background: var(--orange-bg);
    border: 1px solid var(--orange-border);
}

.rec-warn strong {
    color: var(--orange);
}

.rec-warn .rec-highlight {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 800;
    color: var(--orange);
}

.rec-sell {
    background: var(--brown-bg);
    border: 1px solid var(--brown-border);
}

.rec-sell strong {
    color: var(--brown);
}

.rec-sell ul {
    margin: 8px 0 0 24px;
    color: var(--text2);
}

.rec-ok {
    background: var(--green-bg);
    border: 1px solid var(--green-border);
}

.rec-ok strong {
    color: var(--green);
}

/* Days bar */
.days-bar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: flex-end;
}

.days-bar-track {
    width: 70px;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.days-bar-fill {
    height: 100%;
    border-radius: 4px;
    box-shadow: 0 0 8px currentColor;
}

/* Pulse Animation */
@keyframes pulse-neon {

    0%,
    100% {
        opacity: 1;
        text-shadow: 0 0 15px currentColor;
    }

    50% {
        opacity: 0.6;
        text-shadow: none;
    }
}

.pulse {
    animation: pulse-neon 2s ease-in-out infinite;
    font-weight: 800 !important;
}

/* Alert rows (For Dashboard etc.) */
.alert-row {
    display: grid;
    grid-template-columns: 56px 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 14px;
    transition: background 0.2s;
}

.alert-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

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

.alert-photo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    padding: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-info {
    min-width: 0;
}

.alert-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.alert-meta {
    font-size: 12px;
    color: var(--text3);
    margin-top: 4px;
    font-weight: 500;
}

.alert-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    text-align: right;
    min-width: 90px;
}

.alert-val small {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 500;
    font-size: 11px;
    color: var(--text3);
    display: block;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Two-column layout */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.1);
}

.tab {
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.tab:hover {
    color: var(--text2);
}

.tab.active {
    color: var(--text);
    border-bottom-color: var(--blue);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 20px;
    background: var(--blue);
    filter: blur(16px);
    z-index: -1;
    opacity: 0.4;
}

/* Revenue bar */
.rev-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    margin-top: 6px;
    overflow: hidden;
}

.rev-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--blue), var(--purple));
    box-shadow: 0 0 10px rgba(51, 153, 255, 0.5);
}

/* Summary stat */
.stat-row {
    display: flex;
    gap: 40px;
    padding: 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.01);
}

.stat label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text3);
    display: block;
    margin-bottom: 6px;
}

.stat .val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 26px;
    font-weight: 800;
}

.stat .val.red {
    color: var(--red);
    text-shadow: 0 0 15px rgba(255, 51, 102, 0.3);
}

.stat .val.orange {
    color: var(--orange);
}

.stat .val.green {
    color: var(--green);
    text-shadow: 0 0 15px rgba(0, 230, 153, 0.3);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .page {
        padding: 24px;
    }

    .two-col {
        grid-template-columns: 1fr;
        gap: 24px;
    }

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

@media (max-width: 768px) {
    nav {
        padding: 0 20px;
        overflow-x: auto;
    }

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

    .td-name {
        max-width: 220px;
    }

    .health {
        flex-direction: column;
        align-items: flex-start;
        gap: 32px;
    }

    .detail-inner {
        grid-template-columns: 1fr;
    }

    .detail-photo {
        display: none;
    }
}
