@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;700;800&family=Archivo+Black&display=swap");

:root {
    --bg-0: #08111f;
    --bg-1: #101d35;
    --ink-0: #f4f8ff;
    --ink-1: #c4d2e9;
    --glass: rgba(11, 20, 37, 0.54);
    --line: rgba(173, 198, 240, 0.28);
    --accent-a: #ffb6cf;
    --accent-b: #ffd6e4;
    --accent-c: #ffc4db;
    --focus-ring: rgba(255, 182, 207, 0.45);
    --state-success: #7ff3cb;
    --state-warning: #ffd37a;
    --state-danger: #ff9aa8;
    --danger: #ff7a84;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Plus Jakarta Sans", "Trebuchet MS", sans-serif;
    color: var(--ink-0);
    background: radial-gradient(circle at 15% 15%, #54304b 0%, transparent 40%),
        radial-gradient(circle at 85% 10%, #5a2f47 0%, transparent 34%),
        linear-gradient(140deg, var(--bg-0), var(--bg-1));
    overflow-x: hidden;
}

img,
video {
    max-width: 100%;
    height: auto;
}

.bg-glow {
    position: fixed;
    width: 48vw;
    height: 48vw;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.25;
    z-index: -3;
    animation: drift 14s ease-in-out infinite;
}

.bg-glow-a {
    background: var(--accent-a);
    top: -8vw;
    left: -10vw;
}

.bg-glow-b {
    background: var(--accent-b);
    bottom: -16vw;
    right: -10vw;
    animation-delay: 1.2s;
}

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: radial-gradient(circle at center, black 48%, transparent 100%);
}

.app-shell {
    width: min(1080px, 92vw);
    margin: 1.5rem auto 2.5rem;
}

.glass {
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: 22px;
    backdrop-filter: blur(24px) saturate(145%);
    -webkit-backdrop-filter: blur(24px) saturate(145%);
    box-shadow: 0 28px 48px rgba(3, 6, 14, 0.34);
}

.topbar {
    padding: 1rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--ink-0);
    font-family: "Archivo Black", sans-serif;
    letter-spacing: 0.02em;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.95rem;
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(120deg, var(--accent-a), var(--accent-b));
    box-shadow: 0 0 18px rgba(43, 208, 255, 0.8);
}

.nav-pills {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav-section {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(196, 210, 233, 0.9);
    padding: 0 0.25rem;
}

.nav-inline-form {
    margin: 0;
}

.nav-pill-btn {
    color: var(--ink-0);
    text-decoration: none;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    transition: transform 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}

.nav-pill-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.14);
}

.nav-pills a {
    color: var(--ink-0);
    text-decoration: none;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.nav-pills a:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.14);
}

.nav-pills a.is-current {
    background: linear-gradient(120deg, var(--accent-a), var(--accent-b));
    color: #061525;
    border-color: transparent;
    font-weight: 700;
}

.module-nav {
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
}

.module-nav-title {
    margin: 0 0 0.55rem;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(196, 210, 233, 0.9);
}

.module-nav-links {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.module-nav-links a {
    color: var(--ink-0);
    text-decoration: none;
    font-size: 0.88rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.42rem 0.82rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.module-nav-links a:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.14);
}

.module-nav-links a.is-current {
    background: linear-gradient(120deg, var(--accent-a), var(--accent-b));
    color: #061525;
    border-color: transparent;
    font-weight: 700;
}

.flash-stack {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}

.flash {
    border-radius: 12px;
    padding: 0.75rem 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(12, 26, 47, 0.7);
    font-size: 0.92rem;
}

.flash.success {
    border-color: color-mix(in srgb, var(--state-success) 72%, transparent);
}

.flash.error {
    border-color: color-mix(in srgb, var(--state-danger) 90%, transparent);
}

.flash.warning {
    border-color: color-mix(in srgb, var(--state-warning) 80%, transparent);
}

.flash.info {
    border-color: color-mix(in srgb, var(--accent-a) 80%, transparent);
}

.content-area {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.content-area>* {
    min-width: 0;
}

.hero {
    padding: clamp(1.2rem, 3vw, 2rem);
}

.hero-kicker {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-b);
    font-size: 0.73rem;
    font-weight: 700;
}

.hero-title {
    margin: 0.6rem 0;
    font-size: clamp(1.6rem, 3.8vw, 2.8rem);
    line-height: 1.1;
}

.hero-text {
    margin: 0;
    color: var(--ink-1);
    max-width: 60ch;
}

.hero-cta {
    margin-top: 1rem;
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.hero-inline-form {
    margin: 0;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}

.card {
    padding: 1rem;
    grid-column: span 4;
}

.card h2 {
    margin: 0.45rem 0;
    font-size: 1.1rem;
}

.card p {
    margin: 0;
    color: var(--ink-1);
}

.card-label {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.card-accent {
    border-color: rgba(40, 194, 255, 0.7);
}

.auth-wrap {
    min-height: clamp(360px, 70vh, 640px);
    display: grid;
    place-items: center;
}

.stock-layout {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 1rem;
    min-width: 0;
}

.stock-single {
    display: grid;
    min-width: 0;
}

.stock-tabs {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    min-width: 0;
}

.stock-tab {
    color: var(--ink-0);
    text-decoration: none;
    border: 1px solid rgba(173, 198, 240, 0.28);
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    background: rgba(11, 20, 37, 0.35);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.stock-tab:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
}

.stock-tab.is-active {
    background: linear-gradient(120deg, var(--accent-a), var(--accent-b));
    color: #061525;
    font-weight: 700;
    border-color: transparent;
}

.stock-panel {
    padding: 1rem;
    min-width: 0;
}

.stock-panel h2 {
    margin-top: 0;
}

.stock-list {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

.stock-item {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0.8rem;
    border: 1px solid rgba(173, 198, 240, 0.24);
    border-radius: 14px;
    padding: 0.7rem;
    background: rgba(8, 17, 31, 0.34);
}

.stock-thumb {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.stock-thumb span {
    color: var(--ink-1);
    font-size: 0.76rem;
}

.stock-meta h3 {
    margin: 0 0 0.3rem;
}

.stock-meta p {
    margin: 0.1rem 0;
    color: var(--ink-1);
    font-size: 0.92rem;
}

.auth-card {
    width: min(560px, 100%);
    padding: clamp(1.1rem, 3.4vw, 2rem);
}

.auth-card h1 {
    margin: 0.45rem 0 0.35rem;
    font-size: clamp(1.4rem, 4vw, 2rem);
}

.auth-card p {
    margin: 0 0 1rem;
    color: var(--ink-1);
}

.form-stack {
    display: grid;
    gap: 0.9rem;
}

.field-block {
    display: grid;
    gap: 0.4rem;
}

.field-block label {
    font-size: 0.86rem;
    color: rgba(235, 243, 255, 0.9);
}

.ios-input {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(196, 210, 233, 0.38);
    background: rgba(8, 17, 31, 0.55);
    color: var(--ink-0);
    padding: 0.78rem 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrap .ios-input {
    padding-right: 2.8rem;
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    border: 0;
    background: transparent;
    color: rgba(235, 243, 255, 0.85);
    cursor: pointer;
    font-size: 1rem;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.password-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

.password-toggle.is-active {
    color: var(--accent-b);
}

.ios-input:focus {
    outline: none;
    border-color: rgba(40, 194, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(40, 194, 255, 0.2);
}

.field-error {
    color: #ffd0d4;
    font-size: 0.8rem;
}

.field-help {
    color: rgba(196, 210, 233, 0.85);
    font-size: 0.78rem;
}

.nf-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.nf-form-grid .field-block.is-wide {
    grid-column: 1 / -1;
}

.nf-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
    padding-top: 0.25rem;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.nf-import-form {
    max-width: 780px;
}

.ios-input[type="file"] {
    padding: 0.5rem;
}

.ios-input[type="file"]::file-selector-button {
    border: 0;
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    margin-right: 0.7rem;
    background: linear-gradient(120deg, var(--accent-a), var(--accent-b));
    color: #061525;
    font-weight: 700;
    cursor: pointer;
}

.nota-card {
    grid-template-columns: 1fr;
}

.nota-item-card {
    grid-template-columns: 1fr;
}

.nota-actions {
    margin: 0.45rem 0 0.35rem;
}

.nota-items-list {
    margin: 0.35rem 0 0;
    padding-left: 1rem;
}

.nota-items-list li {
    color: var(--ink-1);
    margin: 0.2rem 0;
}

.nota-total {
    margin: 0.6rem 0 0;
}

.list-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(173, 198, 240, 0.24);
    border-radius: 14px;
    background: rgba(8, 17, 31, 0.28);
    padding: 0.45rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.list-table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0 0.42rem;
}

.list-table th,
.list-table td {
    text-align: left;
    vertical-align: top;
    padding: 0.82rem 0.85rem;
    color: var(--ink-1);
    font-size: 0.9rem;
}

.list-table thead th {
    color: var(--ink-0);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(11, 20, 37, 0.72);
    border-bottom: 1px solid rgba(173, 198, 240, 0.24);
    position: sticky;
    top: 0;
    z-index: 1;
}

.list-table thead th:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.list-table thead th:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.list-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.06);
}

.list-table tbody td {
    background: rgba(8, 17, 31, 0.42);
    border-top: 1px solid rgba(173, 198, 240, 0.16);
    border-bottom: 1px solid rgba(173, 198, 240, 0.16);
}

.list-table tbody td:not(:last-child),
.list-table thead th:not(:last-child) {
    border-right: 1px solid rgba(173, 198, 240, 0.12);
}

.list-table tbody tr:nth-child(even) td {
    background: rgba(11, 20, 37, 0.48);
}

.list-table tbody td:first-child {
    border-left: 1px solid rgba(173, 198, 240, 0.16);
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.list-table tbody td:last-child {
    border-right: 1px solid rgba(173, 198, 240, 0.16);
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.list-table td strong {
    color: var(--ink-0);
}

.money-cell {
    color: #ffe1ec;
    font-weight: 700;
    white-space: nowrap;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid rgba(173, 198, 240, 0.22);
    background: rgba(173, 198, 240, 0.16);
    color: var(--ink-0);
}

.status-chip.ok {
    border-color: color-mix(in srgb, var(--state-success) 70%, transparent);
    background: color-mix(in srgb, var(--state-success) 24%, transparent);
}

.status-chip.warn {
    border-color: color-mix(in srgb, var(--state-warning) 72%, transparent);
    background: color-mix(in srgb, var(--state-warning) 25%, transparent);
}

.status-chip.bad {
    border-color: color-mix(in srgb, var(--state-danger) 72%, transparent);
    background: color-mix(in srgb, var(--state-danger) 25%, transparent);
}

.table-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    min-width: 220px;
}

.table-actions .btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.82rem;
}

.list-table-wrap::-webkit-scrollbar {
    height: 10px;
}

.list-table-wrap::-webkit-scrollbar-track {
    background: rgba(8, 17, 31, 0.45);
    border-radius: 999px;
}

.list-table-wrap::-webkit-scrollbar-thumb {
    background: linear-gradient(120deg, var(--accent-a), var(--accent-b));
    border-radius: 999px;
}

.nf-barcode-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.55rem;
    align-items: center;
}

.scan-status {
    margin: 0;
    color: var(--ink-1);
    font-size: 0.84rem;
}

.scan-status.is-error {
    color: #ffd0d4;
}

.barcode-reader {
    display: none;
    width: 100%;
    max-width: 540px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(173, 198, 240, 0.32);
    background: rgba(8, 17, 31, 0.55);
    min-height: 110px;
}

.barcode-reader.is-active {
    display: block;
}

.barcode-reader video {
    width: 100% !important;
    height: auto !important;
    display: block;
}

.nf-barcode-row .btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 0;
    padding: 0.65rem 1rem;
    text-decoration: none;
    color: #061525;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(120deg, var(--accent-a), var(--accent-b));
    box-shadow: 0 10px 22px rgba(255, 170, 200, 0.3);
}

.btn-secondary {
    background: rgba(214, 226, 244, 0.26);
    color: var(--ink-0);
    border: 1px solid rgba(214, 226, 244, 0.3);
}

.is-modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 8, 18, 0.72);
    padding: 1rem;
}

.modal-backdrop[hidden] {
    display: none !important;
}

.modal-card {
    width: min(520px, 100%);
    padding: 1rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.modal-close {
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(214, 226, 244, 0.3);
    border-radius: 999px;
    background: rgba(214, 226, 244, 0.12);
    color: var(--ink-0);
    font-size: 0.95rem;
    cursor: pointer;
}

.modal-text {
    margin: 0.7rem 0 0.9rem;
    color: var(--ink-1);
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-pill-btn:focus-visible,
.stock-tab:focus-visible,
.ios-input:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

[data-reveal] {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

[data-reveal].is-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@keyframes drift {

    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    50% {
        transform: translate3d(2vw, -2vw, 0);
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 900px) {
    .app-shell {
        width: min(100%, 94vw);
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-pills {
        width: 100%;
    }

    .nav-pills a,
    .nav-pill-btn {
        flex: 1 1 calc(33.333% - 0.45rem);
        text-align: center;
        justify-content: center;
        min-width: 148px;
    }

    .module-nav-links a {
        flex: 1 1 calc(33.333% - 0.45rem);
        text-align: center;
        min-width: 148px;
    }

    .stock-item {
        grid-template-columns: 74px 1fr;
    }

    .stock-thumb {
        width: 74px;
        height: 74px;
    }

    .list-table {
        min-width: 860px;
    }

    .list-table th,
    .list-table td {
        padding: 0.72rem 0.7rem;
    }

    .table-actions {
        min-width: 190px;
    }

    .card {
        grid-column: span 6;
    }
}

@media (max-width: 680px) {
    .app-shell {
        margin-top: 1rem;
    }

    .brand {
        font-size: 0.88rem;
    }

    .stock-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.22rem;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .stock-tab {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .nav-pills a,
    .nav-pill-btn,
    .module-nav-links a {
        flex: 1 1 calc(50% - 0.45rem);
        text-align: center;
        min-width: 132px;
    }

    .hero-cta .btn,
    .hero-inline-form,
    .hero-inline-form .btn,
    .nf-actions .btn {
        width: 100%;
    }

    .hero-cta {
        width: 100%;
    }

    .table-actions {
        min-width: 0;
    }

    .table-actions .btn,
    .table-actions .hero-inline-form,
    .table-actions .hero-inline-form .btn {
        width: 100%;
    }

    .stock-item {
        grid-template-columns: 1fr;
    }

    .stock-thumb {
        width: 100%;
        max-width: 110px;
        height: 110px;
    }

    .card {
        grid-column: 1 / -1;
    }

    .hero-title {
        font-size: clamp(1.45rem, 7vw, 2rem);
    }

    .stock-layout {
        grid-template-columns: 1fr;
    }

    .nf-form-grid {
        grid-template-columns: 1fr;
    }

    .nf-barcode-row {
        grid-template-columns: 1fr;
    }

    .list-table {
        min-width: 700px;
    }
}

@media (max-width: 480px) {
    .app-shell {
        width: 96vw;
    }

    .hero {
        padding: 1rem;
    }

    .stock-panel {
        padding: 0.85rem;
    }

    .nav-pills a,
    .nav-pill-btn,
    .module-nav-links a,
    .stock-tab,
    .btn {
        font-size: 0.82rem;
    }

    .modal-card {
        padding: 0.85rem;
    }

    .list-table {
        min-width: 640px;
    }
}