:root {
    color-scheme: dark;
    --bg: #0f141c;
    --paper: rgba(22, 32, 45, 0.92);
    --paper-strong: #172231;
    --ink: #d7e7f5;
    --muted: #8ca2b7;
    --accent: #66c0f4;
    --accent-deep: #2f5f8a;
    --teal: #9bc7e6;
    --teal-deep: #5b8fb4;
    --danger: #e05555;
    --success: #a4d007;
    --warning: #d29922;
    --line: rgba(255, 255, 255, 0.08);
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    --shadow-soft: 0 14px 38px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1000px 520px at 2% -8%, rgba(102, 192, 244, 0.18), transparent 60%),
        radial-gradient(820px 520px at 99% 100%, rgba(63, 104, 145, 0.18), transparent 58%),
        linear-gradient(180deg, #0f141c 0%, #131d2a 42%, #0f141c 100%);
    position: relative;
    overflow-x: hidden;
}

.dashboard-body {
    padding-bottom: 52px;
}

.ambient {
    position: fixed;
    border-radius: 50%;
    filter: blur(4px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

.ambient-one {
    width: 420px;
    height: 420px;
    left: -120px;
    top: -80px;
    background: radial-gradient(circle at 30% 30%, rgba(102, 192, 244, 0.22), rgba(102, 192, 244, 0));
    animation: driftA 16s ease-in-out infinite;
}

.ambient-two {
    width: 520px;
    height: 520px;
    right: -170px;
    bottom: -220px;
    background: radial-gradient(circle at 65% 60%, rgba(63, 104, 145, 0.22), rgba(63, 104, 145, 0));
    animation: driftB 22s ease-in-out infinite;
}

.grid-noise {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(circle at 50% 40%, black, transparent 82%);
}

.landing {
    display: grid;
    place-items: center;
    padding: 28px;
}

.hero-shell,
.dashboard-grid,
.topbar {
    position: relative;
    z-index: 1;
    width: min(1200px, 100%);
}

.landing-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;
    align-items: stretch;
}

.landing-main {
    min-height: 520px;
}

.landing-side {
    padding: clamp(24px, 3vw, 36px);
}

.feature-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 10px;
    color: var(--muted);
    line-height: 1.5;
}

.landing-kpis {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.landing-kpis article {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: rgba(16, 23, 32, 0.82);
}

.landing-kpis span {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.landing-kpis strong {
    display: block;
    margin-top: 6px;
    color: var(--ink);
    font-family: "Fraunces", Georgia, serif;
}

.hero-card,
.panel {
    border-radius: 28px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    background: linear-gradient(145deg, rgba(22, 27, 34, 0.96), rgba(13, 17, 23, 0.92));
    backdrop-filter: blur(10px);
    position: relative;
}

.hero-card {
    padding: clamp(28px, 4.5vw, 64px);
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    right: -42px;
    top: -46px;
    width: 180px;
    height: 180px;
    border-radius: 28px;
    transform: rotate(16deg);
    background: linear-gradient(135deg, rgba(102, 192, 244, 0.22), rgba(63, 104, 145, 0.15));
}

.eyebrow {
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--teal);
}

h1,
h2 {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    letter-spacing: 0.01em;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.55rem);
    line-height: 1.08;
    max-width: 20ch;
    margin-bottom: 20px;
}

h2 {
    font-size: clamp(1.2rem, 2.2vw, 1.65rem);
    margin-bottom: 14px;
    color: var(--accent);
    text-shadow: 0 2px 8px rgba(102, 192, 244, 0.18);
}

.lead {
    max-width: 62ch;
    line-height: 1.7;
    font-size: 1.03rem;
    color: var(--muted);
    margin: 0 0 22px;
}

.hero-footnote {
    margin-top: 20px;
    color: var(--muted);
    font-size: 0.86rem;
}

.status {
    margin: 0;
    color: var(--accent);
    font-size: 0.95rem;
}

.actions,
.topbar-actions,
.inline-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.button {
    border: 0;
    border-radius: 999px;
    padding: 12px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: all 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.button:active {
    transform: translateY(0);
}

.button.primary {
    color: #081622;
    box-shadow: 0 14px 30px rgba(35, 81, 122, 0.45);
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
}

.button.primary:hover {
    box-shadow: 0 18px 36px rgba(31, 82, 126, 0.55);
    background: linear-gradient(135deg, #8bd6ff, #3b6f99);
}

.button.ghost {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.button.ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.24);
}

.button.danger {
    color: #fff8f6;
    background: linear-gradient(135deg, #bf433c, #8f2e2c);
}

.button.danger:hover {
    background: linear-gradient(135deg, #d94a42, #a83530);
    box-shadow: 0 10px 24px rgba(225, 85, 85, 0.25);
}

.mt-8 {
    margin-top: 8px;
}

.m-0 {
    margin: 0;
}

.w-full {
    width: 100%;
}

.flex-1 {
    flex: 1;
}

.topbar {
    margin: 26px auto 10px;
    padding: 22px;
    border-radius: 22px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    background: linear-gradient(135deg, rgba(22, 27, 34, 0.97), rgba(16, 22, 30, 0.95));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.topbar-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.dashboard-grid {
    margin: 18px auto 40px;
    display: grid;
    gap: 18px;
}

.panel {
    padding: 24px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.summary-grid article {
    background: linear-gradient(155deg, var(--paper-strong), rgba(18, 24, 32, 0.92));
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.summary-grid article::before {
    content: "";
    position: absolute;
    inset: -40% -20% auto auto;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(102, 192, 244, 0.16), rgba(102, 192, 244, 0));
}

.summary-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.summary-grid strong {
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(1.35rem, 2.2vw, 1.9rem);
}

.inventory-info {
    margin-bottom: 18px;
    font-size: 0.95rem;
    color: var(--muted);
}

.inventory-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

.inventory-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 10px;
}

.kpi-chip {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 9px 11px;
    background: linear-gradient(145deg, rgba(22, 32, 45, 0.92), rgba(15, 20, 28, 0.94));
}

.kpi-chip span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    margin-bottom: 3px;
}

.kpi-chip strong {
    font-family: "Fraunces", Georgia, serif;
    font-size: 0.98rem;
    color: var(--ink);
}

.inventory-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.inventory-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.inventory-form.compact {
    gap: 6px;
}

.inventory-form.compact .button {
    padding: 8px 12px;
    font-size: 0.82rem;
}

.compact-main-select {
    min-width: 132px;
}

.inventory-form select {
    padding: 7px 9px;
    background: rgba(14, 22, 31, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: var(--ink);
    font-size: 0.82rem;
}

.inventory-mini-input {
    padding: 7px 9px;
    min-width: 120px;
    background: rgba(14, 22, 31, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: var(--ink);
    font-size: 0.82rem;
}

.inventory-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.82rem;
}

.inventory-advanced {
    width: 100%;
    margin-top: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(16, 24, 34, 0.44);
    padding: 5px 8px;
}

.inventory-advanced summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.78rem;
    user-select: none;
}

.inventory-advanced-grid {
    margin-top: 6px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.inventory-help {
    margin-top: 6px;
}

.inventory-help p {
    margin: 6px 0 0;
}

.inventory-status-banner {
    margin-top: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 8px 10px;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.inventory-status-banner .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    display: inline-block;
}

.inventory-status-banner.ok {
    color: #bce8d0;
    background: rgba(67, 160, 104, 0.16);
    border-color: rgba(97, 187, 133, 0.36);
}

.inventory-status-banner.warn {
    color: #ffe6bf;
    background: rgba(194, 138, 42, 0.18);
    border-color: rgba(215, 160, 65, 0.36);
}

.inventory-status-banner.off {
    color: #ffd4cd;
    background: rgba(168, 74, 74, 0.2);
    border-color: rgba(206, 102, 102, 0.38);
}

.pager {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.button.is-disabled {
    pointer-events: none;
    opacity: 0.45;
}

.market-table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 16px;
}

.market-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1020px;
    background: linear-gradient(180deg, rgba(14, 20, 28, 0.9), rgba(16, 24, 34, 0.8));
}

.market-table thead th {
    text-align: left;
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: rgba(17, 26, 37, 0.95);
    z-index: 1;
}

.market-table tbody td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.86rem;
    vertical-align: middle;
    color: rgba(227, 233, 239, 0.95);
}

.market-table tbody tr:hover {
    background: rgba(102, 192, 244, 0.1);
}

.market-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

.market-item-cell {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 260px;
}

.market-item-cell strong {
    font-size: 0.9rem;
    line-height: 1.3;
    color: #f0f4f8;
}

.market-thumb {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.market-thumb-fallback {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(140deg, rgba(90, 116, 142, 0.32), rgba(36, 55, 75, 0.2));
}

.spread {
    font-weight: 600;
}

.spread.up {
    color: #a4d007;
}

.spread.down {
    color: #ff9f86;
}

.price-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.price-status.ok {
    color: #bce8d0;
    background: rgba(67, 160, 104, 0.18);
    border-color: rgba(97, 187, 133, 0.42);
}

.price-status.warn {
    color: #ffe6bf;
    background: rgba(194, 138, 42, 0.2);
    border-color: rgba(215, 160, 65, 0.42);
}

.price-status.off {
    color: #c7d2dc;
    background: rgba(118, 135, 150, 0.2);
    border-color: rgba(143, 158, 171, 0.42);
}

.inventory-search {
    min-width: 200px;
    width: min(320px, 100%);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(14, 22, 31, 0.9);
    color: var(--ink);
    padding: 8px 10px;
    font-size: 0.84rem;
}

.inventory-search:focus {
    outline: none;
    border-color: rgba(102, 192, 244, 0.7);
    box-shadow: 0 0 0 3px rgba(102, 192, 244, 0.16);
}

.inventory-card-detailed .card-body {
    gap: 8px;
}

.inventory-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.inventory-flags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.flag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.72rem;
    padding: 4px 8px;
    border: 1px solid var(--line);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
}

.flag.flag-ok {
    color: #bde4ff;
    background: rgba(102, 192, 244, 0.18);
    border-color: rgba(102, 192, 244, 0.35);
}

.flag.flag-warn {
    color: #ffd7ba;
    background: rgba(210, 153, 34, 0.2);
    border-color: rgba(210, 153, 34, 0.35);
}

.inventory-card-actions {
    margin-top: 6px;
}

.inventory-info strong {
    color: var(--teal);
    font-weight: 600;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.inventory-card {
    border-radius: 14px;
    border: 1px solid rgba(130, 152, 176, 0.22);
    background: linear-gradient(155deg, rgba(14, 19, 26, 0.98), rgba(19, 25, 34, 0.94));
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.inventory-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    border-color: rgba(102, 192, 244, 0.5);
}

.card-header {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, rgba(53, 74, 97, 0.28), rgba(20, 31, 44, 0.45));
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}

.item-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.item-image-placeholder {
    width: 78px;
    height: 78px;
    border-radius: 12px;
    border: 1px solid rgba(160, 184, 207, 0.25);
    background: linear-gradient(160deg, rgba(95, 125, 152, 0.34), rgba(47, 68, 88, 0.18));
}

.card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.item-name {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
    font-family: "Space Grotesk", sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.item-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 4px;
    font-weight: 600;
}

.stat .value {
    font-size: 0.95rem;
    color: var(--ink);
    font-weight: 500;
}

.item-pricing {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
}

.price-row.total {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(102, 192, 244, 0.28);
}

.price-label {
    color: var(--muted);
    font-weight: 500;
}

.price-value {
    color: var(--ink);
    font-weight: 600;
    font-family: "Fraunces", Georgia, serif;
}

.price-value.accent {
    color: var(--teal);
    font-size: 1.05rem;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 12px;
    border-radius: 14px;
    border: 1px solid rgba(160, 184, 207, 0.28);
    background: linear-gradient(145deg, rgba(91, 116, 140, 0.26), rgba(40, 56, 74, 0.16));
}

.sticker-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 0;
}

.sticker-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    border-radius: 999px;
    border: 1px solid rgba(164, 188, 213, 0.32);
    background: rgba(24, 37, 51, 0.72);
    max-width: 220px;
}

.sticker-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 700;
    color: #e7f3ff;
    background: linear-gradient(145deg, #4f7ea8, #345a7f);
    flex-shrink: 0;
}

.sticker-name {
    font-size: 0.74rem;
    color: #d9e8f6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rules-container {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.rule-card {
    border-radius: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(155deg, rgba(22, 27, 34, 0.98), rgba(16, 22, 30, 0.92));
    padding: 16px;
    transition: all 0.2s ease;
}

.rule-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 192, 244, 0.35);
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.rule-id {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    font-family: "Fraunces", Georgia, serif;
}

.rule-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(102, 192, 244, 0.18);
    color: var(--teal);
}

.rule-status.disabled {
    background: rgba(225, 85, 85, 0.15);
    color: var(--danger);
}

.rule-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.rule-stat {
    display: flex;
    flex-direction: column;
}

.rule-stat .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 4px;
    font-weight: 600;
}

.rule-stat .value {
    font-size: 0.95rem;
    color: var(--ink);
    font-weight: 600;
}

.rule-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(225, 85, 85, 0.1);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--danger);
}

.error-icon {
    flex-shrink: 0;
}

.rule-actions {
    display: flex;
    gap: 8px;
}

.sales-container {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.sale-card {
    border-radius: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(155deg, rgba(22, 27, 34, 0.98), rgba(16, 22, 30, 0.92));
    padding: 16px;
    transition: all 0.2s ease;
}

.sale-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 192, 244, 0.35);
}

.sale-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.sale-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
}

.sale-date {
    font-size: 0.8rem;
    color: var(--muted);
}

.sale-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.sale-stat {
    display: flex;
    flex-direction: column;
}

.sale-stat .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 4px;
    font-weight: 600;
}

.sale-stat .value {
    font-size: 0.95rem;
    color: var(--ink);
    font-weight: 600;
}

.sale-stat .value.accent {
    color: var(--success);
}

.sale-notes {
    padding: 10px;
    background: rgba(102, 192, 244, 0.12);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--muted);
}

.table-list {
    display: grid;
    gap: 11px;
    margin-top: 10px;
}

.table-list.compact {
    gap: 8px;
}

.table-row {
    border-radius: 15px;
    border: 1px solid var(--line);
    background: linear-gradient(155deg, rgba(22, 27, 34, 0.96), rgba(16, 22, 30, 0.88));
    padding: 16px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
    transition: all 0.2s ease;
}

.table-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(102, 192, 244, 0.16);
    background: linear-gradient(155deg, rgba(30, 35, 44, 0.98), rgba(20, 26, 35, 0.92));
    border-color: rgba(102, 192, 244, 0.35);
}

.table-row strong {
    font-size: 1rem;
    color: var(--accent);
}

.table-row p {
    margin: 4px 0;
    font-size: 0.92rem;
}

.align-right {
    text-align: right;
    min-width: 140px;
}

.align-right p {
    font-weight: 500;
}

.muted,
.table-row p {
    color: var(--muted);
}

.two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.stack-form {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 600;
}

.info-box {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-item .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 600;
}

.info-value {
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
    color: var(--accent);
    background: rgba(102, 192, 244, 0.12);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(102, 192, 244, 0.24);
    word-break: break-all;
}

.two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.two-col > div {
    display: flex;
    flex-direction: column;
}

.two-col > div:first-child {
    padding-right: 12px;
    border-right: 1px solid var(--line);
}

.analytics-page-grid {
    z-index: 1;
    position: relative;
}

.analytics-title {
    margin: 0;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(155deg, var(--paper-strong), rgba(18, 24, 32, 0.92));
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    text-align: center;
}

.stat-card .label {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .value {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--ink);
}

.stat-card.positive .value {
    color: var(--teal);
}

.stat-card.negative .value {
    color: var(--danger);
}

.item-selector {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.analytics-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.analytics-label.push-right {
    margin-left: auto;
}

.item-selector select {
    padding: 10px 14px;
    background: rgba(22, 27, 34, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--ink);
    font-family: inherit;
    cursor: pointer;
}

.item-selector select:focus {
    outline: none;
    border-color: rgba(102, 192, 244, 0.72);
    box-shadow: 0 0 0 3px rgba(102, 192, 244, 0.16);
}

.chart-section {
    background: linear-gradient(135deg, rgba(22, 27, 34, 0.96), rgba(16, 22, 30, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

.chart-section h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-family: "Fraunces", Georgia, serif;
    color: var(--ink);
    font-size: 1.3rem;
}

.chart-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 400px;
    margin: 20px 0;
}

.loading {
    text-align: center;
    color: var(--muted);
    padding: 40px;
}

.error {
    background: rgba(224, 85, 85, 0.1);
    border: 1px solid rgba(224, 85, 85, 0.3);
    border-radius: 8px;
    color: var(--danger);
    padding: 16px;
    margin-bottom: 20px;
}

.is-hidden {
    display: none;
}

.reveal-1,
.reveal-2,
.reveal-3,
.reveal-4,
.reveal-5,
.reveal-6 {
    opacity: 0;
    transform: translateY(14px) scale(0.995);
    animation: reveal 0.65s ease forwards;
}

.reveal-2 { animation-delay: 0.06s; }
.reveal-3 { animation-delay: 0.12s; }
.reveal-4 { animation-delay: 0.18s; }
.reveal-5 { animation-delay: 0.24s; }
.reveal-6 { animation-delay: 0.30s; }

@keyframes reveal {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes driftA {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(24px, 18px); }
}

@keyframes driftB {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-18px, -24px); }
}

@media (max-width: 980px) {
    .landing-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid,
    .two-col {
        grid-template-columns: 1fr;
    }

    .two-col > div:first-child {
        padding-right: 0;
        padding-bottom: 16px;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .topbar {
        margin-top: 14px;
        flex-direction: column;
        align-items: flex-start;
    }

    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .inventory-kpis {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .inventory-search {
        min-width: 220px;
    }

    .inventory-form {
        width: 100%;
    }

    .analytics-label.push-right {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .landing {
        padding: 14px;
    }

    .hero-card,
    .panel,
    .topbar {
        border-radius: 18px;
        padding: 16px;
    }

    .table-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-row div:last-child {
        width: 100%;
    }

    .align-right {
        text-align: left;
        min-width: unset;
    }

    .button {
        width: 100%;
    }

    .two-col > div:first-child {
        padding-right: 0;
        padding-bottom: 16px;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }

    .inventory-kpis {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .inventory-controls {
        width: 100%;
    }

    .inventory-form {
        width: 100%;
    }

    .inventory-form .button {
        width: auto;
    }

    .inventory-search {
        width: 100%;
        min-width: 0;
    }

    .card-header {
        height: 160px;
    }

    .item-image-placeholder {
        font-size: 3rem;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .chart-section {
        padding: 16px;
    }

    .chart-container {
        height: 300px;
    }
}