:root {
    --pos-bg: #eef2ff;
    --pos-bg-deep: #dbeafe;
    --pos-panel: #ffffff;
    --pos-ink: #0f172a;
    --pos-muted: #64748b;
    --pos-line: rgba(15, 23, 42, 0.08);
    --pos-accent: #2563eb;
    --pos-accent-deep: #1d4ed8;
    --pos-accent-soft: rgba(37, 99, 235, 0.12);
    --pos-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body.pos-page {
    margin: 0;
    min-height: 100vh;
    color: #0f172a;
    font-family: "DM Sans", "Segoe UI", sans-serif;
    background: #f3f5f9;
}

.inv-app {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns 0.22s ease;
}

.inv-app.is-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
}

.inv-sidebar {
    background: #111827;
    color: #e5e7eb;
    padding: 22px 16px;
    overflow: hidden;
    transition: padding 0.22s ease;
}

.inv-app.is-collapsed .inv-sidebar {
    padding: 0;
}

.inv-backdrop {
    display: none;
}

.inv-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    padding: 0 8px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.inv-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #d9f99d;
    color: #111827;
}

.inv-brand-mark svg,
.inv-nav svg {
    width: 18px;
    height: 18px;
}

.inv-nav {
    display: grid;
    gap: 6px;
}

.inv-nav a,
.inv-nav .is-soon {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: #cbd5e1;
    font-weight: 600;
    text-decoration: none;
}

.inv-nav a.is-active {
    background: #1d4ed8;
    color: #fff;
}

.inv-nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.inv-nav .is-soon {
    opacity: 0.55;
}

.inv-main {
    min-width: 0;
}

.inv-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 72px;
    padding: 0 28px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.inv-topbar-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.inv-menu {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: transparent;
    cursor: pointer;
}

.inv-menu:hover { background: #f1f5f9; }

.inv-menu span {
    width: 18px;
    height: 2px;
    background: #111827;
    box-shadow: 0 -6px 0 #111827, 0 6px 0 #111827;
}

.inv-topbar h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.inv-user {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: right;
}

.inv-user strong,
.inv-user span {
    display: block;
}

.inv-user span {
    color: #64748b;
    font-size: 13px;
}

.inv-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #e2e8f0;
    font-weight: 700;
}

.inv-content {
    padding: 22px 28px 36px;
}

.inv-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.inv-stat,
.inv-panel {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.inv-stat {
    padding: 18px 18px 16px;
}

.inv-stat p {
    margin: 14px 0 6px;
    color: #64748b;
    font-size: 14px;
}

.inv-stat strong {
    display: block;
    font-size: 32px;
    letter-spacing: -0.04em;
}

.inv-stat a,
.inv-panel header a {
    color: #2563eb;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.inv-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: grid;
    place-items: center;
}

.inv-stat-icon svg { width: 18px; height: 18px; }
.inv-stat-icon.is-blue { background: #dbeafe; color: #2563eb; }
.inv-stat-icon.is-green { background: #dcfce7; color: #16a34a; }
.inv-stat-icon.is-amber { background: #fef3c7; color: #d97706; }
.inv-stat-icon.is-red { background: #fee2e2; color: #dc2626; }
.inv-stat-icon.is-violet { background: #ede9fe; color: #7c3aed; }
.inv-stat-icon.is-teal { background: #ccfbf1; color: #0f766e; }

.inv-panels {
    display: grid;
    grid-template-columns: 1fr 1fr 1.15fr;
    gap: 16px;
    margin-top: 16px;
}

.inv-panel {
    padding: 8px 8px 12px;
}

.inv-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 12px 8px;
}

.inv-panel h2 {
    margin: 0;
    font-size: 16px;
}

.inv-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    color: inherit;
    text-decoration: none;
}

.inv-row + .inv-row {
    border-top: 1px solid #f1f5f9;
}

.inv-thumb {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
}

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

.inv-row-copy {
    min-width: 0;
}

.inv-row-copy strong,
.inv-row-copy small,
.inv-row-stock,
.inv-row-stock small,
.inv-move small {
    display: block;
}

.inv-row-copy strong {
    font-size: 14px;
}

.inv-row-copy small,
.inv-row-stock small,
.inv-move small {
    color: #94a3b8;
    font-size: 12px;
}

.inv-row-stock {
    text-align: right;
    font-size: 13px;
    font-weight: 700;
}

.inv-row-stock.is-low { color: #d97706; }
.inv-row-stock.is-out { color: #dc2626; }

.inv-move {
    display: grid;
    justify-items: end;
    gap: 2px;
    text-align: right;
}

.inv-badge {
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
}

.inv-badge.is-in,
.inv-move strong.is-in { color: #16a34a; }
.inv-badge.is-out,
.inv-move strong.is-out { color: #dc2626; }
.inv-badge.is-in { background: #dcfce7; }
.inv-badge.is-out { background: #fee2e2; }

.inv-empty {
    margin: 8px 12px 12px;
    color: #64748b;
    font-size: 14px;
}

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

@media (max-width: 820px) {
    .inv-app,
    .inv-app.is-collapsed { grid-template-columns: 1fr; }
    .inv-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 40;
        width: 248px;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
    }
    .inv-app:not(.is-collapsed) .inv-sidebar { transform: translateX(0); }
    .inv-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 35;
        border: 0;
        padding: 0;
        background: rgba(15, 23, 42, 0.45);
        cursor: pointer;
    }
    .inv-app:not(.is-collapsed) .inv-backdrop { display: block; }
    .inv-stats,
    .inv-panels { grid-template-columns: 1fr; }
    .inv-content,
    .inv-topbar { padding-left: 16px; padding-right: 16px; }
}

.pos-shell {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 40px;
}

.pos-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.pos-kicker {
    margin: 0 0 6px;
    color: var(--pos-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.pos-top h1,
.pos-panel h2,
.pos-catalog h2 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: -0.04em;
}

.pos-top h1 {
    font-size: clamp(34px, 5vw, 52px);
}

.pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 22px;
    align-items: start;
}

.pos-catalog,
.pos-panel-inner {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    box-shadow: var(--pos-shadow);
    backdrop-filter: blur(10px);
}

.pos-catalog {
    padding: 22px;
}

.pos-catalog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.pos-catalog-head h2 {
    font-size: 24px;
}

.pos-catalog-head span,
.pos-muted,
.pos-hint,
.pos-card-meta {
    color: var(--pos-muted);
}

.pos-empty {
    padding: 48px 24px;
    text-align: center;
    border: 1px dashed var(--pos-line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.55);
}

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

.pos-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: hidden;
    border: 1px solid var(--pos-line);
    border-radius: 22px;
    background: #fff;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.pos-card:hover,
.pos-card.is-active {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.12);
}

.pos-card-media {
    aspect-ratio: 1.15;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.pos-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pos-card-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: var(--pos-accent-soft);
    color: var(--pos-accent);
    font-family: "Space Grotesk", sans-serif;
    font-size: 32px;
    font-weight: 700;
}

.pos-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
}

.pos-card-body h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
}

.pos-card-meta {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.pos-card-desc {
    margin: 4px 0 0;
    color: var(--pos-muted);
    font-size: 14px;
    line-height: 1.45;
}

.pos-card-edit {
    margin: 0 16px 16px;
    padding: 11px 14px;
    border-radius: 14px;
    background: #f8fafc;
    color: var(--pos-accent-deep);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.pos-panel {
    position: sticky;
    top: 20px;
}

.pos-panel-inner {
    padding: 22px;
}

.pos-panel h2 {
    margin-bottom: 18px;
    font-size: 28px;
}

.pos-form {
    display: grid;
    gap: 16px;
}

.pos-split {
    display: grid;
    gap: 14px;
}

.pos-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
}

.pos-field input,
.pos-field textarea {
    width: 100%;
    border: 1px solid var(--pos-line);
    border-radius: 16px;
    padding: 14px 16px;
    background: #fff;
    color: var(--pos-ink);
    font: inherit;
}

.pos-field input:focus,
.pos-field textarea:focus {
    outline: 2px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

.pos-field input[type="file"] {
    padding: 11px 14px;
    background: #f8fafc;
}

.pos-preview {
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid var(--pos-line);
    border-radius: 18px;
}

.pos-preview img {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
}

.pos-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--pos-muted);
    font-size: 14px;
    font-weight: 600;
}

.pos-hint {
    margin: 8px 0 0;
    font-size: 13px;
}

.pos-error {
    margin: 8px 0 0;
    color: #b42318;
    font-size: 14px;
}

.pos-btn,
.pos-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 16px;
    padding: 14px 18px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.pos-btn {
    background: linear-gradient(135deg, var(--pos-accent) 0%, var(--pos-accent-deep) 100%);
    color: #fff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24);
}

.pos-btn-ghost {
    background: #fff;
    color: var(--pos-ink);
    border: 1px solid var(--pos-line);
}

@media (min-width: 760px) {
    .pos-split { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 980px) {
    .pos-layout { grid-template-columns: 1fr; }
    .pos-panel { position: static; }
}

@media (max-width: 640px) {
    .pos-shell { width: min(1280px, calc(100% - 20px)); }
    .pos-top { align-items: flex-start; flex-direction: column; }
}

.catalog {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    padding: 18px;
}

.catalog-toolbar,
.catalog-filters {
    display: flex;
    align-items: end;
    gap: 12px;
}

.catalog-toolbar { margin-bottom: 14px; }

.catalog-search {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 8px 0 14px;
    background: #fff;
}

.catalog-search input {
    width: 100%;
    border: 0;
    padding: 12px 0;
    font: inherit;
    background: transparent;
}

.catalog-search input:focus { outline: none; }

.catalog-search button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.catalog-search svg { width: 18px; height: 18px; }

.catalog-new {
    display: inline-flex;
    align-items: center;
    border-radius: 12px;
    padding: 12px 16px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.catalog-filters {
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.catalog-filters label {
    display: grid;
    gap: 6px;
    min-width: 180px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.catalog-filters select {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    color: #0f172a;
    font: inherit;
}

.catalog-clear,
.catalog-back {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.catalog-clear { margin-bottom: 10px; }

.catalog-table-wrap { overflow-x: auto; }

.catalog-table {
    width: 100%;
    border-collapse: collapse;
}

.catalog-table th {
    padding: 12px 10px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    background: #f8fafc;
}

.catalog-table td {
    padding: 14px 10px;
    border-top: 1px solid #f1f5f9;
    vertical-align: middle;
}

.catalog-name { font-weight: 700; }

.catalog-thumb {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
}

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

.catalog-stock { font-weight: 700; }
.catalog-stock.is-ok { color: #16a34a; }
.catalog-stock.is-low { color: #d97706; }
.catalog-stock.is-out { color: #dc2626; }

.catalog-badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.catalog-badge.is-ok { background: #dcfce7; color: #15803d; }
.catalog-badge.is-low { background: #ffedd5; color: #c2410c; }
.catalog-badge.is-out { background: #fee2e2; color: #b91c1c; }

.catalog-actions { min-width: 88px; }

.catalog-empty {
    padding: 28px 10px;
    color: #64748b;
    text-align: center;
}

.catalog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    color: #64748b;
    font-size: 14px;
}

.catalog-footer p { margin: 0; }

.catalog-pager {
    display: flex;
    gap: 6px;
}

.catalog-pager a,
.catalog-pager span {
    min-width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #f8fafc;
    color: #0f172a;
    text-decoration: none;
    font-weight: 700;
}

.catalog-pager .is-current {
    background: #2563eb;
    color: #fff;
}

.catalog-form {
    max-width: 860px;
}

.catalog-form h2 {
    margin: 0 0 18px;
    font-family: "DM Sans", sans-serif;
    font-size: 28px;
}

.catalog-back { display: inline-flex; margin-bottom: 12px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 820px) {
    .catalog-toolbar,
    .catalog-footer { align-items: stretch; flex-direction: column; }
}
