:root {
    --pos-primary: #3157d5;
    --pos-primary-dark: #2445ae;
    --pos-ink: #111827;
    --pos-muted: #6b7280;
    --pos-soft: #f6f8fb;
    --pos-surface: #eef2f6;
    --pos-card: #ffffff;
    --pos-border: #dde4ee;
    --pos-green: #0f8f6d;
    --pos-amber: #b7791f;
    --pos-red: #c2413a;
}

* {
    letter-spacing: 0;
}

body {
    color: var(--pos-ink);
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.min-w-0 {
    min-width: 0;
}

.btn {
    border-radius: 10px;
    font-weight: 650;
}

.btn-primary {
    --bs-btn-bg: var(--pos-primary);
    --bs-btn-border-color: var(--pos-primary);
    --bs-btn-hover-bg: var(--pos-primary-dark);
    --bs-btn-hover-border-color: var(--pos-primary-dark);
}

.btn-light {
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--pos-border);
    --bs-btn-hover-bg: #f8fafc;
    --bs-btn-hover-border-color: #cfd8e6;
}

.form-control {
    border-color: var(--pos-border);
    border-radius: 12px;
}

.form-control:focus,
.form-check-input:focus {
    border-color: var(--pos-primary);
    box-shadow: 0 0 0 0.2rem rgba(49, 87, 213, 0.12);
}

.auth-shell {
    background:
        radial-gradient(circle at 18% 12%, rgba(49, 87, 213, 0.18), transparent 28rem),
        radial-gradient(circle at 84% 86%, rgba(15, 143, 109, 0.16), transparent 26rem),
        #eef2f6;
}

.auth-card {
    width: min(100%, 1120px);
    min-height: 660px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(17, 24, 39, 0.16);
}

.auth-panel {
    position: relative;
    overflow: hidden;
    min-height: 660px;
    background:
        linear-gradient(140deg, rgba(8, 12, 24, 0.88), rgba(8, 12, 24, 0.96)),
        radial-gradient(circle at 28% 26%, rgba(49, 87, 213, 0.52), transparent 23rem),
        radial-gradient(circle at 85% 82%, rgba(15, 143, 109, 0.3), transparent 19rem),
        #080c18;
    color: #fff;
}

.auth-panel::after {
    position: absolute;
    inset: auto -8rem -12rem auto;
    width: 28rem;
    height: 28rem;
    content: "";
    border: 56px solid rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.auth-logo {
    width: 230px;
    height: auto;
}

.auth-logo-mobile {
    width: 180px;
    height: auto;
}

.auth-panel-top,
.auth-preview {
    position: relative;
    z-index: 1;
}

.auth-eyebrow,
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 999px;
    padding: 0.5rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.auth-eyebrow {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.86);
}

.auth-title {
    max-width: 620px;
    font-size: clamp(2.35rem, 4vw, 4.4rem);
    line-height: 1.02;
    font-weight: 800;
}

.auth-copy {
    max-width: 560px;
    color: rgba(255, 255, 255, 0.64);
    font-size: 1.05rem;
}

.auth-preview {
    width: min(100%, 520px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.preview-header,
.preview-scan,
.preview-grid {
    display: flex;
    align-items: center;
}

.preview-header {
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.82rem;
}

.preview-header strong {
    color: #fff;
}

.preview-scan {
    gap: 1rem;
    margin: 1rem 0;
    border-radius: 16px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
}

.preview-scan i {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    background: #fff;
    color: var(--pos-primary);
    font-size: 1.35rem;
}

.preview-grid {
    gap: 0.65rem;
}

.preview-grid > div {
    flex: 1;
    border-radius: 14px;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.08);
}

.preview-grid span {
    display: block;
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.75rem;
}

.preview-grid strong {
    display: block;
    margin-top: 0.25rem;
}

.form-kicker {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--pos-primary);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.form-field .form-label {
    font-weight: 700;
}

.demo-credential {
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 0.9rem;
    background: #f8fafc;
}

.demo-credential code {
    color: #1f2937;
    font-size: 0.82rem;
}

.app-shell {
    min-height: 100vh;
    background:
        linear-gradient(180deg, #f7f9fc 0%, #eef2f6 100%);
}

.app-frame {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    position: sticky;
    top: 0;
    flex: 0 0 284px;
    height: 100vh;
    padding: 1.25rem;
    flex-direction: column;
    border-right: 1px solid var(--pos-border);
    background: rgba(255, 255, 255, 0.78);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    min-height: 54px;
    margin-bottom: 1.5rem;
    text-decoration: none;
}

.brand-logo {
    width: 164px;
    height: auto;
}

.mobile-logo {
    width: 132px;
    height: auto;
}

.sidebar-section {
    margin: 1rem 0 0.5rem;
    color: var(--pos-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.sidebar-nav {
    display: grid;
    gap: 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 13px;
    padding: 0.78rem 0.85rem;
    color: #3f4858;
    text-decoration: none;
    font-weight: 700;
}

.sidebar-link i {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
}

.sidebar-link.active {
    background: #eef4ff;
    color: var(--pos-primary);
}

.sidebar-link.active i {
    background: #dce8ff;
    color: var(--pos-primary);
}

.sidebar-link.disabled {
    opacity: 0.56;
    cursor: default;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: auto;
    border: 1px solid var(--pos-border);
    border-radius: 18px;
    padding: 0.85rem;
    background: #fff;
}

.user-avatar {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    background: #111827;
    color: #fff;
    font-weight: 800;
}

.app-main {
    min-width: 0;
    flex: 1;
}

.app-topbar {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 78px;
    border-bottom: 1px solid rgba(221, 228, 238, 0.84);
    padding: 0 1rem;
    background: rgba(247, 249, 252, 0.86);
}

.topbar-kicker {
    color: var(--pos-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.topbar-title {
    margin: 0;
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    font-weight: 800;
}

.topbar-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.status-pill {
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--pos-border);
    border-radius: 999px;
    padding: 0.42rem 0.75rem;
    background: #fff;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 750;
}

.status-pill i {
    color: var(--pos-green);
    font-size: 0.5rem;
}

.app-content {
    max-width: 1480px;
    padding: 1rem;
}

.hero-panel {
    overflow: hidden;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 24px;
    padding: clamp(1.25rem, 3vw, 2rem);
    background:
        linear-gradient(135deg, rgba(17, 24, 39, 0.94), rgba(22, 31, 53, 0.96)),
        radial-gradient(circle at 18% 20%, rgba(49, 87, 213, 0.46), transparent 25rem),
        #111827;
    color: #fff;
    box-shadow: 0 24px 70px rgba(17, 24, 39, 0.16);
}

.hero-badge {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.82);
}

.hero-title {
    max-width: 790px;
    font-size: clamp(2rem, 4vw, 4.1rem);
    line-height: 1.02;
    font-weight: 850;
}

.hero-copy {
    max-width: 720px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 1.05rem;
}

.hero-action {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 52px;
    padding-inline: 1.15rem;
}

.scan-console {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.08);
}

.scan-console-head,
.scan-console-list > div,
.tech-row,
.action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scan-console-head {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.82rem;
}

.scan-console-head strong {
    color: #8ee3c4;
}

.scan-input-preview {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1rem 0;
    border-radius: 16px;
    padding: 1rem;
    background: #fff;
    color: #111827;
    font-weight: 800;
}

.scan-input-preview i {
    color: var(--pos-primary);
    font-size: 1.35rem;
}

.scan-console-list {
    display: grid;
    gap: 0.65rem;
}

.scan-console-list > div {
    border-radius: 14px;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.08);
}

.scan-console-list span {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.78rem;
}

.metric-card,
.content-panel {
    height: 100%;
    border: 1px solid rgba(17, 24, 39, 0.07);
    border-radius: 20px;
    background: var(--pos-card);
    box-shadow: 0 18px 42px rgba(17, 24, 39, 0.07);
}

.metric-card {
    position: relative;
    overflow: hidden;
    padding: 1.2rem;
}

.metric-card::after {
    position: absolute;
    inset: auto -2rem -2rem auto;
    width: 7rem;
    height: 7rem;
    content: "";
    border-radius: 50%;
    opacity: 0.09;
}

.metric-blue::after {
    background: var(--pos-primary);
}

.metric-green::after {
    background: var(--pos-green);
}

.metric-amber::after {
    background: var(--pos-amber);
}

.metric-red::after {
    background: var(--pos-red);
}

.metric-icon {
    display: grid;
    width: 44px;
    height: 44px;
    margin-bottom: 1rem;
    place-items: center;
    border-radius: 14px;
    background: #f1f5f9;
    font-size: 1.15rem;
}

.metric-blue .metric-icon {
    color: var(--pos-primary);
}

.metric-green .metric-icon {
    color: var(--pos-green);
}

.metric-amber .metric-icon {
    color: var(--pos-amber);
}

.metric-red .metric-icon {
    color: var(--pos-red);
}

.metric-label {
    color: var(--pos-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.metric-value {
    margin: 0.3rem 0;
    font-size: clamp(1.65rem, 3vw, 2rem);
    font-weight: 850;
}

.metric-note {
    color: var(--pos-muted);
    font-size: 0.82rem;
}

.content-panel {
    padding: 1.25rem;
}

.table-modern {
    margin: 0;
}

.table-modern thead th {
    color: #64748b;
    font-size: 0.76rem;
    text-transform: uppercase;
}

.table-modern tbody td {
    padding-block: 1rem;
}

.part-number {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    background: #f1f5f9;
    color: #334155;
    font-weight: 800;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.38rem 0.62rem;
    font-size: 0.76rem;
    font-weight: 800;
}

.status-tag.success {
    background: #dcfce7;
    color: #166534;
}

.status-tag.muted {
    background: #f1f5f9;
    color: #64748b;
}

.stack-panel {
    height: auto;
}

.tech-row {
    border-top: 1px solid #edf1f6;
    padding: 0.85rem 0;
}

.tech-row:first-of-type {
    border-top: 0;
}

.tech-row span,
.action-row span {
    color: #64748b;
}

.action-panel {
    height: auto;
}

.action-row {
    justify-content: flex-start;
    gap: 0.75rem;
    border-radius: 14px;
    padding: 0.75rem;
    background: #f8fafc;
}

.action-row + .action-row {
    margin-top: 0.6rem;
}

.action-row i {
    color: var(--pos-primary);
}

.master-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.master-form {
    max-width: 1120px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.25rem;
    border-top: 1px solid #edf1f6;
    padding-top: 1rem;
}

.pagination {
    margin-bottom: 0;
}

.code-helper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid #dbe4ef;
    border-radius: 14px;
    padding: 0.9rem;
    background: #f8fafc;
}

.receipt-items {
    display: grid;
    gap: 1rem;
}

.receipt-item-row {
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    padding: 1rem;
    background: #fbfdff;
}

.scan-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.scan-row-form {
    border: 1px solid #dbe4ef;
    border-radius: 14px;
    padding: 0.85rem;
    background: #fbfdff;
}

.receipt-scan-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.receipt-scan-list span {
    border: 1px solid #dbe4ef;
    border-radius: 999px;
    padding: 0.35rem 0.6rem;
    background: #f8fafc;
    font-size: 0.82rem;
}

.stock-scan-form,
.scan-result {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stock-scan-form .scan-input {
    min-height: 46px;
}

.scan-icon {
    display: grid;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    place-items: center;
    border-radius: 14px;
    background: #111827;
    color: #fff;
    font-size: 1.35rem;
}

.scan-result {
    justify-content: space-between;
    border: 1px solid var(--pos-border);
    border-radius: 16px;
    padding: 1rem;
    background: #f8fafc;
}

.scan-result-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.stock-split-input {
    width: 96px;
}

@media (min-width: 992px) {
    .app-content {
        padding: 1.5rem;
    }

    .app-topbar {
        padding: 0 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .auth-card {
        min-height: auto;
        border-radius: 20px;
    }

    .preview-grid,
    .scan-console-list {
        grid-template-columns: 1fr;
    }

    .scan-input-preview {
        align-items: flex-start;
        word-break: break-word;
    }

    .stock-scan-form,
    .scan-result,
    .scan-result-meta {
        align-items: stretch;
        flex-direction: column;
    }

    .stock-split-input {
        width: 100%;
    }
}
