:root {
    color-scheme: dark;
    --bg: #070b0c;
    --sidebar: #060a0b;
    --surface: #101718;
    --surface-2: #162021;
    --surface-3: #1c2828;
    --field: #0a1112;
    --line: #2b3a38;
    --line-soft: rgba(151, 171, 165, 0.14);
    --text: #f3f7f5;
    --muted: #91a39d;
    --green: #83e52f;
    --green-ink: #0a1c04;
    --green-soft: rgba(131, 229, 47, 0.12);
    --blue: #72c9fa;
    --blue-soft: rgba(114, 201, 250, 0.12);
    --cyan: #52d7ce;
    --amber: #ffc766;
    --amber-soft: rgba(255, 199, 102, 0.12);
    --red: #ff7272;
    --red-soft: rgba(255, 114, 114, 0.12);
    --radius: 8px;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
    --ease-out: cubic-bezier(0.2, 0.75, 0.25, 1);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.45;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 65%);
}

body.menu-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button,
a,
input,
select {
    -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 16px 16px;
    background: var(--sidebar);
    border-right: 1px solid var(--line-soft);
}

.sidebar::before {
    content: "";
    position: absolute;
    top: 0;
    right: -1px;
    width: 1px;
    height: 118px;
    background: var(--green);
    box-shadow: 0 0 18px rgba(131, 229, 47, 0.38);
    animation: sidebar-signal 4.8s var(--ease-out) infinite;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 0 6px 22px;
    border-bottom: 1px solid var(--line-soft);
    transition: transform 240ms var(--ease-out);
}

.brand:hover {
    transform: translateX(3px);
}

.brand-logo {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #f5f7f6;
    box-shadow: 0 0 0 4px var(--green-soft);
    transition: transform 320ms var(--ease-out), box-shadow 320ms ease;
}

.brand:hover .brand-logo {
    transform: rotate(-3deg) scale(1.04);
    box-shadow: 0 0 0 5px var(--green-soft), 0 0 28px rgba(131, 229, 47, 0.16);
}

.brand-copy {
    min-width: 0;
}

.brand-copy strong,
.brand-copy small {
    display: block;
}

.brand-copy strong {
    font-size: 20px;
    line-height: 1.1;
    letter-spacing: 0;
}

.brand-copy small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.nav {
    display: grid;
    gap: 4px;
    margin-top: 20px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.nav-label {
    padding: 4px 12px 7px;
    color: #63736e;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.nav-label.secondary {
    margin-top: 16px;
}

.nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 43px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
    overflow: hidden;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms var(--ease-out);
}

.nav a:hover {
    color: var(--text);
    background: var(--surface);
    transform: translateX(3px);
}

.nav a.active {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--line-soft);
}

.nav a.active::after {
    content: "";
    position: absolute;
    top: 9px;
    right: 0;
    bottom: 9px;
    width: 2px;
    border-radius: 2px 0 0 2px;
    background: var(--green);
    box-shadow: 0 0 14px rgba(131, 229, 47, 0.55);
    animation: active-nav-in 360ms var(--ease-out) both;
}

.nav-mark {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border: 1px solid #53635e;
    border-radius: 50%;
}

.nav a.active .nav-mark {
    border-color: var(--green);
    background: var(--green);
    box-shadow: 0 0 0 4px var(--green-soft);
}

.sidebar-user {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 14px 6px 2px;
    border-top: 1px solid var(--line-soft);
}

.user-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--green);
    color: var(--green-ink);
    font-weight: 900;
}

.sidebar-user-copy {
    min-width: 0;
}

.sidebar-user-copy strong,
.sidebar-user-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-copy strong {
    font-size: 13px;
}

.sidebar-user-copy small {
    color: var(--muted);
    font-size: 11px;
}

.signout-link {
    color: var(--muted);
    font-size: 12px;
}

.signout-link:hover {
    color: var(--red);
}

.sidebar-scrim,
.mobile-nav {
    display: none;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 26px;
    background: rgba(10, 14, 15, 0.9);
    border-bottom: 1px solid var(--line-soft);
    backdrop-filter: blur(16px);
}

.topbar::after {
    content: "";
    position: absolute;
    right: 26px;
    bottom: -1px;
    width: 72px;
    height: 1px;
    background: var(--green);
    box-shadow: 0 0 12px rgba(131, 229, 47, 0.34);
    animation: topbar-scan 5.5s var(--ease-out) infinite;
}

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

.topbar-actions,
.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.connection-status {
    gap: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.connection-status > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px var(--green-soft);
    animation: status-pulse 2.2s ease-in-out infinite;
}

.topbar h1,
.topbar p {
    margin: 0;
}

.topbar h1 {
    max-width: 700px;
    font-size: 24px;
    line-height: 1.15;
}

.eyebrow {
    display: block;
    color: var(--green);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0;
}

.page {
    width: min(1540px, 100%);
    margin: 0 auto;
    padding: 24px 26px 40px;
}

.page-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 20px;
    padding: 2px 2px 16px;
    border-bottom: 1px solid var(--line-soft);
    animation: rise-in 420ms var(--ease-out) both;
}

.page-intro h2,
.page-intro p {
    margin: 0;
}

.page-intro h2 {
    margin-top: 5px;
    font-size: 22px;
}

.muted {
    color: var(--muted);
}

.panel,
.stat-card,
.quick-action {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
    animation: rise-in 420ms var(--ease-out) both;
}

.panel {
    padding: 20px;
    margin-bottom: 18px;
    transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms var(--ease-out);
}

.panel:hover {
    border-color: rgba(131, 229, 47, 0.2);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
}

.panel.narrow {
    max-width: 820px;
}

.panel-header {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 17px;
}

.panel-header h2,
.panel-header p {
    margin: 0;
}

.panel-header h2 {
    margin-top: 3px;
    font-size: 17px;
    line-height: 1.25;
}

.stats-grid,
.quick-grid,
.two-column,
.three-column,
.security-layout {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.security-layout {
    grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1fr);
    align-items: start;
}

.align-start {
    align-items: start;
}

.stat-card {
    position: relative;
    min-height: 128px;
    padding: 20px;
    overflow: hidden;
    isolation: isolate;
    transition: transform 220ms var(--ease-out), border-color 220ms ease, box-shadow 220ms ease;
}

.stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 42%;
    height: 2px;
    background: var(--green);
    transform: scaleX(0.28);
    transform-origin: left;
    opacity: 0.7;
    transition: transform 360ms var(--ease-out), width 360ms var(--ease-out);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(131, 229, 47, 0.32);
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.28);
}

.stat-card:hover::before {
    width: 100%;
    transform: scaleX(1);
}

.stat-card::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 18px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 5px var(--green-soft);
    animation: stat-beacon 2.8s ease-in-out infinite;
}

.stat-card span {
    display: block;
    max-width: calc(100% - 24px);
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    display: block;
    font-size: 28px;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.stat-card.accent-blue::after {
    background: var(--blue);
    box-shadow: 0 0 0 5px var(--blue-soft);
}

.stat-card.accent-cyan::after {
    background: var(--cyan);
    box-shadow: 0 0 0 5px rgba(82, 215, 206, 0.12);
}

.stat-card.accent-amber::after {
    background: var(--amber);
    box-shadow: 0 0 0 5px var(--amber-soft);
}

.quick-action {
    position: relative;
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    overflow: hidden;
    transition: transform 190ms var(--ease-out), border-color 190ms ease, background 190ms ease, box-shadow 190ms ease;
}

.quick-action span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--muted);
    font-size: 10px;
    transition: transform 220ms var(--ease-out), background 220ms ease;
}

.quick-action:hover {
    transform: translateY(-3px);
    border-color: rgba(131, 229, 47, 0.45);
    background: var(--surface-2);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.quick-action:hover span {
    transform: rotate(-5deg) scale(1.08);
    background: var(--green-soft);
    color: var(--green);
}

.quick-action.primary-action {
    border-color: var(--green);
    background: var(--green);
    color: var(--green-ink);
}

.quick-action.primary-action span {
    background: rgba(8, 33, 19, 0.12);
    color: var(--green-ink);
}

.button,
.icon-button {
    position: relative;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--surface-3);
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    transition: transform 170ms var(--ease-out), background 170ms ease, border-color 170ms ease, opacity 170ms ease, box-shadow 170ms ease;
}

.button.primary {
    border-color: var(--green);
    background: var(--green);
    color: var(--green-ink);
    box-shadow: 0 8px 24px rgba(131, 229, 47, 0.14);
}

.button:hover,
.icon-button:hover {
    transform: translateY(-2px);
}

.button.primary:hover {
    background: #97ee4c;
    box-shadow: 0 12px 30px rgba(131, 229, 47, 0.2);
}

.button:active,
.icon-button:active,
.quick-action:active {
    transform: translateY(0) scale(0.98);
}

.button.whatsapp {
    border-color: rgba(88, 229, 140, 0.45);
    background: #1fa855;
    color: #ffffff;
}

.button.whatsapp:hover {
    background: #27b861;
}

.button.ghost {
    border-color: var(--line);
    background: transparent;
}

.button.ghost:hover {
    background: var(--surface-2);
    border-color: #435253;
}

.button.danger {
    border-color: rgba(255, 114, 114, 0.45);
    background: var(--red-soft);
    color: #ffb0b0;
}

.button.small {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
}

.button.big {
    min-height: 52px;
    font-size: 16px;
}

.button.full {
    width: 100%;
}

.button:disabled,
.icon-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.icon-button {
    width: 42px;
    padding: 0;
}

.menu-button {
    display: none;
    flex-direction: column;
    gap: 4px;
    border-color: var(--line);
    background: var(--surface);
}

.menu-button span {
    width: 17px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

label {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    transition: color 170ms ease;
}

label:focus-within {
    color: var(--green);
}

input,
select {
    width: 100%;
    min-height: 43px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: none;
    background: var(--field);
    color: var(--text);
    font-weight: 500;
}

input::placeholder {
    color: #5f706b;
}

input:focus,
select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-soft);
    transform: translateY(-1px);
}

input,
select {
    transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms var(--ease-out), background 170ms ease;
}

input[type="date"] {
    color-scheme: dark;
}

input[type="file"] {
    padding: 9px 11px;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-2 {
    grid-column: span 2;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.field-group {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.field-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.input-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 43px;
    gap: 7px;
}

.composite-editor {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: var(--field);
}

.composite-fields,
.component-list {
    display: grid;
    gap: 9px;
}

.component-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px auto;
    align-items: end;
    gap: 9px;
}

.component-row {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: var(--surface-2);
}

.component-row strong,
.component-row span {
    display: block;
}

.component-row strong {
    font-size: 13px;
}

.component-row span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.component-empty {
    margin: 2px;
    font-size: 12px;
}

.field-ignored {
    opacity: 0.48;
}

.field-ignored::after {
    content: "El stock del combo se calcula con sus componentes";
    color: var(--amber);
    font-size: 10px;
    font-weight: 500;
}

.compact-dialog {
    width: min(460px, calc(100vw - 28px));
}

.product-image-editor {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 13px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: var(--field);
}

.product-image-preview {
    width: 150px;
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #eef2f0;
}

.product-image-preview img {
    width: 100%;
    height: 100%;
    padding: 6px;
    object-fit: contain;
}

.product-image-preview span {
    color: #66716e;
    font-size: 11px;
    font-weight: 750;
}

.product-image-preview.empty {
    background: var(--surface-2);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
}

.filters label {
    min-width: 180px;
}

.report-intro {
    align-items: center;
}

.report-intro p {
    margin-top: 7px;
}

.report-filter-panel {
    border-top-color: rgba(131, 229, 47, 0.38);
}

.report-filter-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 15px;
}

.report-filter-heading strong {
    display: block;
    margin-top: 5px;
    font-size: 17px;
}

.report-range-presets {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.report-range-presets button {
    min-height: 36px;
    padding: 0 13px;
    border: 0;
    border-right: 1px solid var(--line);
    background: var(--field);
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    transition: background 170ms ease, color 170ms ease, transform 170ms var(--ease-out);
}

.report-range-presets button:last-child {
    border-right: 0;
}

.report-range-presets button:hover,
.report-range-presets button.active {
    background: var(--green-soft);
    color: var(--green);
}

.report-range-presets button:active {
    transform: scale(0.96);
}

.report-filters {
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
}

.report-stats .report-negative {
    border-color: rgba(255, 114, 114, 0.32);
}

.report-stats .report-negative::after,
.report-stats .report-negative::before {
    background: var(--red);
}

.report-flow-panel {
    overflow: hidden;
}

.report-result-badge {
    padding: 7px 10px;
    border: 1px solid currentColor;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 800;
}

.report-result-badge.positive {
    background: var(--green-soft);
}

.report-result-badge.negative {
    background: var(--red-soft);
}

.report-result-badge.neutral {
    border-color: var(--blue);
    background: var(--blue-soft);
    color: var(--blue);
}

.report-flow-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.75fr) minmax(360px, 1.25fr);
    gap: 28px;
    align-items: center;
}

.report-net-result {
    min-height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 22px;
    border-left: 3px solid var(--green);
    background: var(--field);
}

.report-net-result > span,
.report-net-result p {
    color: var(--muted);
    font-size: 12px;
}

.report-net-result strong {
    display: block;
    margin: 9px 0;
    color: var(--green);
    font-size: 34px;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.report-net-result strong.negative {
    color: var(--red);
}

.report-net-result strong.neutral {
    color: var(--blue);
}

.report-net-result p {
    margin: 0;
}

.report-bars {
    display: grid;
    gap: 18px;
}

.report-bar-row {
    display: grid;
    gap: 8px;
    transition: transform 180ms var(--ease-out);
}

.report-bar-row:hover {
    transform: translateX(4px);
}

.report-bar-row > div {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    font-size: 12px;
}

.report-bar-row span {
    color: var(--muted);
}

.report-progress {
    width: 100%;
    height: 9px;
    overflow: hidden;
    border: 0;
    border-radius: 4px;
    background: var(--field);
}

.report-progress::-webkit-progress-bar {
    background: var(--field);
}

.report-progress.sales::-webkit-progress-value {
    background: var(--green);
}

.report-progress.expenses::-webkit-progress-value {
    background: var(--amber);
}

.report-progress.salaries::-webkit-progress-value {
    background: var(--blue);
}

.report-progress.sales::-moz-progress-bar {
    background: var(--green);
}

.report-progress.expenses::-moz-progress-bar {
    background: var(--amber);
}

.report-progress.salaries::-moz-progress-bar {
    background: var(--blue);
}

.report-payment-list .report-total-line {
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px solid var(--green);
}

.report-box-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.report-box-block {
    display: grid;
    gap: 7px;
    min-height: 142px;
    padding: 16px;
    border: 1px solid var(--line-soft);
    border-bottom: 2px solid var(--green);
    border-radius: 6px;
    background: var(--field);
    transition: transform 190ms var(--ease-out), border-color 190ms ease;
}

.report-box-block:hover {
    transform: translateY(-3px);
    border-color: rgba(131, 229, 47, 0.4);
}

.report-box-block span {
    color: var(--muted);
    font-size: 11px;
}

.report-box-block b {
    margin-top: auto;
    color: var(--green);
    font-size: 18px;
}

.salary-report-row {
    background: rgba(114, 201, 250, 0.06);
}

.salary-report-row td:first-child {
    border-left: 2px solid var(--blue);
}

.report-period-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-period-grid table {
    min-width: 460px;
}

tbody tr {
    transition: background 150ms ease;
}

tbody tr:hover {
    background: rgba(131, 229, 47, 0.045);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
}

table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

.two-column table,
.three-column table {
    min-width: 0;
}

th,
td {
    padding: 12px 13px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    vertical-align: middle;
}

th {
    background: rgba(255, 255, 255, 0.018);
    color: #7f918b;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

td {
    font-size: 13px;
}

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

tbody tr:hover td {
    background: rgba(255, 255, 255, 0.018);
}

.center {
    text-align: center;
}

.actions,
.inline-form,
.user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-form input {
    width: 124px;
    min-height: 34px;
}

.user-actions {
    min-width: 300px;
}

.user-actions .inline-form input {
    width: 174px;
}

.badge {
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: capitalize;
    white-space: nowrap;
}

.badge.ok {
    border-color: rgba(88, 229, 140, 0.22);
    background: var(--green-soft);
    color: #a4f5bf;
}

.badge.warn {
    border-color: rgba(255, 199, 102, 0.22);
    background: var(--amber-soft);
    color: #ffda98;
}

.danger-row td {
    background: rgba(255, 114, 114, 0.055);
}

.disabled-row {
    opacity: 0.58;
}

.payment-list {
    display: grid;
}

.payment-list div {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 3px;
    border-bottom: 1px solid var(--line-soft);
}

.payment-list div:last-child {
    border-bottom: 0;
}

.payment-list span {
    color: var(--muted);
    text-transform: capitalize;
}

.stock-alert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.stock-alert {
    display: grid;
    gap: 5px;
    padding: 13px;
    border-left: 3px solid var(--amber);
    background: var(--amber-soft);
}

.stock-alert span {
    color: #c9b992;
    font-size: 12px;
}

.operations-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.operations-strip a {
    position: relative;
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    transition: border-color 190ms ease, transform 190ms var(--ease-out), box-shadow 190ms ease;
}

.operations-strip a:hover {
    transform: translateY(-3px);
    border-color: rgba(114, 201, 250, 0.45);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}

.operations-strip strong {
    min-width: 34px;
    color: var(--blue);
    font-size: 24px;
    transition: transform 220ms var(--ease-out), color 220ms ease;
}

.operations-strip a:hover strong {
    transform: translateX(3px);
    color: var(--green);
}

.operations-strip span,
.goal-values span,
.daily-summary-value span {
    color: var(--muted);
    font-size: 12px;
}

.goal-track {
    width: 100%;
    height: 10px;
    margin: 4px 0 12px;
    overflow: hidden;
    border: 0;
    border-radius: 4px;
    background: var(--field);
}

.goal-track::-webkit-progress-bar {
    background: var(--field);
}

.goal-track::-webkit-progress-value,
.goal-track::-moz-progress-bar {
    background: var(--green);
    box-shadow: 0 0 14px rgba(131, 229, 47, 0.24);
}

.goal-values,
.comparison-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.goal-values strong {
    display: block;
    margin-top: 3px;
    color: var(--text);
}

.inline-goal-form {
    display: grid;
    grid-template-columns: minmax(135px, 0.7fr) minmax(180px, 1fr) auto;
    gap: 8px;
    margin-top: 16px;
}

.comparison-line {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.positive {
    color: var(--green);
}

.negative {
    color: var(--red);
}

.daily-summary-value {
    display: grid;
    gap: 5px;
    margin: 4px 0 18px;
}

.daily-summary-value strong {
    font-size: 32px;
}

.restock-grid,
.reminder-list {
    display: grid;
    gap: 9px;
}

.restock-item,
.reminder-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: var(--surface-2);
}

.restock-item strong,
.restock-item span,
.reminder-row strong,
.reminder-row span {
    display: block;
}

.restock-item span,
.reminder-row span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.restock-item b {
    color: var(--green);
    white-space: nowrap;
}

.reminder-row.overdue {
    border-left: 3px solid var(--amber);
}

.reminder-row p {
    max-width: 650px;
    margin: 8px 0 0;
    color: #c6d0cd;
    font-size: 12px;
}

.order-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(240px, 1fr));
    align-items: start;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.order-column {
    min-width: 240px;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: rgba(17, 23, 24, 0.72);
}

.order-column-head {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.order-column-head h2 {
    margin: 0;
    font-size: 14px;
}

.order-column-head span {
    min-width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.order-list {
    display: grid;
    gap: 9px;
}

.order-card {
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-left: 3px solid var(--amber);
    border-radius: 6px;
    background: var(--surface-2);
}

.order-card.status-preparando {
    border-left-color: var(--blue);
}

.order-card.status-listo {
    border-left-color: var(--green);
}

.order-card.status-entregado {
    border-left-color: #61716c;
    opacity: 0.7;
}

.order-card-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.order-card-head span,
.order-card-head strong {
    display: block;
}

.order-card-head span,
.order-card time,
.empty-column {
    color: var(--muted);
    font-size: 11px;
}

.order-card p {
    min-height: 36px;
    margin: 10px 0;
    color: #c8d2cf;
    font-size: 12px;
}

.order-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.order-card-actions form {
    margin: 0;
}

.empty-column {
    margin: 14px 4px;
    text-align: center;
}

.sale-extra-fields {
    margin-top: 14px;
}

.order-queue-option,
.retroactive-sale {
    margin-top: 13px;
}

.retroactive-sale {
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: var(--field);
}

.retroactive-sale summary {
    color: var(--blue);
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
}

.retroactive-sale[open] summary {
    margin-bottom: 12px;
}

.badge.historical {
    border-color: rgba(114, 201, 250, 0.28);
    background: var(--blue-soft);
    color: #b8e4fc;
}

.fixed-printer-row {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 11px 12px;
    border: 1px solid rgba(88, 229, 140, 0.28);
    border-radius: 6px;
    background: var(--green-soft);
}

.fixed-printer-row strong {
    display: block;
    margin-top: 2px;
}

.box-summary > .panel-header > strong {
    color: var(--green);
    font-size: 20px;
}

.cantina-box > .panel-header > strong {
    color: var(--amber);
}

.box-note {
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 12px;
}

.salary-form {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(130px, 0.8fr) minmax(150px, 0.8fr) auto;
    align-items: end;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
}

.salary-form h3 {
    margin: 3px 0 0;
    font-size: 14px;
}

.salary-paid {
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px;
    border: 1px solid rgba(88, 229, 140, 0.24);
    border-radius: 6px;
    background: var(--green-soft);
}

.salary-paid strong,
.salary-paid small {
    display: block;
}

.salary-paid small {
    margin-top: 2px;
    color: var(--muted);
}

.sales-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 386px;
    align-items: start;
    gap: 16px;
}

.sale-products,
.cart-panel {
    margin-bottom: 0;
}

.cart-panel {
    position: sticky;
    top: 100px;
    border-top-color: rgba(131, 229, 47, 0.34);
}

.search-input {
    max-width: 310px;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 16px;
}

.tab {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 700;
    text-transform: capitalize;
    transition: transform 170ms var(--ease-out), color 170ms ease, background 170ms ease, border-color 170ms ease;
}

.tab:hover {
    color: var(--text);
    background: var(--surface-2);
    transform: translateY(-1px);
}

.tab.active {
    border-color: var(--green);
    background: var(--green-soft);
    color: var(--green);
    box-shadow: inset 0 -2px 0 var(--green);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
    gap: 11px;
}

.product-button {
    position: relative;
    min-height: 220px;
    display: grid;
    grid-template-rows: 118px auto auto;
    align-content: space-between;
    gap: 10px;
    padding: 10px;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: transform 210ms var(--ease-out), border-color 210ms ease, background 210ms ease, box-shadow 210ms ease;
}

.product-button::after {
    content: "";
    position: absolute;
    right: 10px;
    bottom: 0;
    left: 10px;
    height: 2px;
    background: var(--green);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 260ms var(--ease-out);
}

.product-button:hover {
    transform: translateY(-5px);
    border-color: rgba(131, 229, 47, 0.55);
    background: var(--surface-3);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
}

.product-button:hover::after {
    transform: scaleX(1);
}

.product-button:active {
    transform: translateY(0) scale(0.985);
}

.product-button:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    transform: none;
}

.product-button strong {
    min-height: 38px;
    align-content: center;
    font-size: 14px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.product-art {
    width: 100%;
    height: 118px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 6px;
    background: #f2f5f3;
}

.product-art img {
    width: 100%;
    height: 100%;
    padding: 7px;
    object-fit: contain;
    transition: transform 260ms var(--ease-out), filter 260ms ease;
}

.product-button:hover .product-art img {
    transform: scale(1.075);
    filter: saturate(1.06) contrast(1.03);
}

.product-meta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 7px;
    color: var(--muted);
    font-size: 11px;
}

.product-meta span:first-child {
    color: var(--green);
    font-size: 12px;
    font-weight: 850;
}

.cart-lines {
    display: grid;
    gap: 8px;
    min-height: 102px;
    max-height: 360px;
    margin-bottom: 14px;
    overflow-y: auto;
}

.cart-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 11px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: var(--field);
}

.cart-line strong {
    display: block;
    margin-bottom: 3px;
    font-size: 13px;
}

.cart-line .muted {
    font-size: 11px;
}

.cart-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-controls button {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
}

.cart-controls input {
    width: 50px;
    min-height: 30px;
    padding: 0 3px;
    text-align: center;
}

.remove-line {
    border-color: rgba(255, 114, 114, 0.3) !important;
    background: var(--red-soft) !important;
    color: var(--red) !important;
}

.cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 15px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.cart-total span {
    color: var(--muted);
}

.cart-total strong {
    color: var(--green);
    font-size: 25px;
}

.cart-panel > label {
    margin-top: 12px;
}

.sale-message {
    min-height: 20px;
    margin: 11px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.sale-message.success {
    color: #a4f5bf;
}

.sale-message.error {
    color: #ffabab;
}

.sale-message.warning {
    color: var(--amber);
}

.hidden {
    display: none !important;
}

.print-option-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 8px;
    margin-top: 12px;
}

.print-option-row .checkbox-line {
    min-height: 40px;
}

.print-summary {
    min-height: 18px;
    margin: 6px 2px 10px;
    color: var(--muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.field-note {
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
}

.payment-proof-preview {
    min-height: 72px;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    margin-top: 9px;
    padding: 8px;
    border: 1px solid rgba(88, 229, 140, 0.28);
    border-radius: 6px;
    background: var(--green-soft);
}

.payment-proof-preview img {
    width: 62px;
    height: 54px;
    object-fit: cover;
    border-radius: 5px;
    background: var(--surface-2);
}

.payment-proof-preview strong {
    display: block;
    margin-bottom: 6px;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkbox-line {
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: var(--field);
}

.checkbox-line input {
    width: 17px;
    min-height: 17px;
    accent-color: var(--green);
}

.table-thumb {
    width: 58px;
    height: 44px;
    display: inline-block;
    padding: 3px;
    object-fit: contain;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: #eef2f0;
}

.table-thumb.empty {
    background: var(--surface-2);
}

.proof-link {
    width: 64px;
    display: grid;
    grid-template-columns: 29px auto;
    align-items: center;
    gap: 5px;
    color: var(--green);
    font-weight: 750;
    text-decoration: none;
}

.proof-link img {
    width: 29px;
    height: 29px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-2);
}

.proof-link:hover {
    color: #b2f8c9;
}

.security-intro h2,
.security-note h2 {
    margin: 6px 0 8px;
    font-size: 21px;
}

.security-intro p,
.security-note p {
    margin: 0;
}

.security-note {
    border-left: 3px solid var(--blue);
}

.security-note .actions {
    margin-top: 18px;
}

.flash-stack {
    position: fixed;
    right: 20px;
    top: 94px;
    z-index: 60;
    display: grid;
    gap: 9px;
}

.flash {
    width: min(390px, calc(100vw - 28px));
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left-width: 3px;
    border-radius: 6px;
    background: var(--surface-2);
    box-shadow: var(--shadow);
    color: var(--text);
}

.flash.success {
    border-left-color: var(--green);
}

.flash.error {
    border-left-color: var(--red);
}

.flash.warning {
    border-left-color: var(--amber);
}

.flash.flash-out {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 200ms ease, transform 200ms ease;
}

.empty-state {
    display: grid;
    justify-items: start;
    gap: 14px;
    padding: 32px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--surface);
}

.empty-state h2 {
    margin: 0;
}

.auth-page {
    min-height: 100vh;
    background: #030708;
}

.login-shell {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(390px, 500px) minmax(0, 1fr);
    overflow: hidden;
    background-color: #030708;
    background-image: url("../img/arba-night-field.png");
    background-position: center;
    background-size: cover;
    animation: login-in 700ms var(--ease-out) both;
}

.login-shell::after {
    content: "";
    position: relative;
    grid-column: 2;
    grid-row: 1;
    pointer-events: none;
    border-left: 1px solid rgba(131, 229, 47, 0.14);
}

.login-access {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    grid-column: 1;
    grid-row: 1;
    min-height: 100vh;
    padding: 34px 48px 42px;
    background: rgba(3, 8, 9, 0.91);
    backdrop-filter: blur(8px);
    box-shadow: 26px 0 70px rgba(0, 0, 0, 0.34);
}

.login-identity {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--line-soft);
    animation: login-content-in 620ms 120ms var(--ease-out) both;
}

.login-logo {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #f4f6f5;
    box-shadow: 0 0 0 5px var(--green-soft), 0 14px 36px rgba(0, 0, 0, 0.4);
    animation: logo-breathe 4s ease-in-out infinite;
}

.login-identity strong,
.login-identity p {
    display: block;
    margin: 0;
}

.login-identity strong {
    margin-top: 3px;
    font-size: 21px;
    line-height: 1.05;
}

.login-identity p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    padding: 52px 0 26px;
    animation: login-content-in 680ms 220ms var(--ease-out) both;
}

.login-heading {
    margin-bottom: 29px;
}

.login-heading h1,
.login-heading p {
    margin: 0;
}

.login-heading h1 {
    max-width: 330px;
    margin-top: 8px;
    font-size: 36px;
    line-height: 1.08;
}

.login-heading p {
    max-width: 340px;
    margin-top: 10px;
    font-size: 13px;
}

.login-form {
    gap: 17px;
}

.login-form input {
    min-height: 50px;
    border-color: rgba(160, 184, 176, 0.24);
    background: rgba(4, 10, 11, 0.72);
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-right: 60px;
}

.password-toggle {
    position: absolute;
    top: 5px;
    right: 5px;
    bottom: 5px;
    min-width: 48px;
    padding: 0 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 11px;
    font-weight: 750;
}

.password-toggle:hover {
    background: var(--green-soft);
    color: var(--green);
}

.login-submit {
    justify-content: space-between;
    margin-top: 5px;
    padding: 0 18px;
}

.login-submit-mark {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 50%;
    background: rgba(10, 28, 4, 0.12);
    transition: transform 220ms var(--ease-out);
}

.login-submit:hover .login-submit-mark {
    transform: translateX(4px);
}

.login-security {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 22px 0 0;
    color: #72847e;
    font-size: 11px;
}

.login-security span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px var(--green-soft);
    animation: status-pulse 2.2s ease-in-out infinite;
}

.login-scene-copy {
    position: absolute;
    right: 54px;
    bottom: 46px;
    z-index: 2;
    padding: 18px 20px;
    border-left: 2px solid var(--green);
    background: rgba(3, 8, 9, 0.74);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
    animation: scene-copy-in 720ms 460ms var(--ease-out) both;
}

.login-scene-copy p,
.login-scene-copy strong {
    display: block;
    margin: 0;
}

.login-scene-copy p {
    color: #b5c4bf;
    font-size: 13px;
}

.login-scene-copy strong {
    margin-top: 4px;
    font-size: 20px;
}

.auth-flashes {
    position: static;
    margin: -8px 0 16px;
}

.auth-flashes .flash {
    width: 100%;
}

.ticket-frame {
    position: fixed;
    width: 0;
    height: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.ticket-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: #e9eeeb;
    color: #111827;
}

.receipt {
    width: 320px;
    padding: 16px;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.receipt-head {
    padding-bottom: 10px;
    border-bottom: 1px dashed #111827;
    text-align: center;
}

.receipt-head img {
    width: 72px;
    height: 72px;
    margin-bottom: 8px;
    object-fit: cover;
    border-radius: 50%;
}

.receipt-head h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.1;
}

.receipt-head p,
.receipt-footer {
    margin: 5px 0 0;
    font-size: 12px;
}

.receipt-meta {
    display: grid;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px dashed #111827;
    font-size: 12px;
}

.receipt-table {
    min-width: 0;
    color: #111827;
}

.receipt-table th,
.receipt-table td {
    padding: 7px 2px;
    border-bottom: 1px solid #e5e7eb;
    background: transparent;
    color: #111827;
    font-size: 12px;
}

.receipt-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed #111827;
}

.receipt-total strong {
    font-size: 18px;
}

.receipt-footer {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0;
}

.receipt-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.receipt-action-block {
    width: 320px;
    max-width: 100%;
}

.receipt-page-status {
    min-height: 19px;
    margin: 8px 0 0;
    color: #4b5563;
    font-size: 12px;
    text-align: center;
}

.receipt-page-status.success {
    color: #166534;
}

.receipt-page-status.error {
    color: #b91c1c;
}

.app-dialog {
    width: min(560px, calc(100vw - 28px));
    max-width: none;
    max-height: calc(100vh - 28px);
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
}

.app-dialog::backdrop {
    background: rgba(2, 6, 7, 0.78);
    backdrop-filter: blur(4px);
}

.dialog-shell {
    max-height: calc(100vh - 28px);
    padding: 20px;
    overflow-y: auto;
    border: 1px solid #354243;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    animation: dialog-in 180ms ease both;
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.dialog-header h2 {
    margin: 3px 0 0;
    font-size: 19px;
}

.dialog-close {
    flex: 0 0 auto;
    min-height: 38px;
    border-color: var(--line);
    background: var(--field);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 16px;
}

.dialog-status {
    min-height: 19px;
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.dialog-status.success {
    color: #a4f5bf;
}

.dialog-status.warning {
    color: var(--amber);
}

.dialog-status.error {
    color: #ffabab;
}

.bluetooth-printer-box {
    display: grid;
    gap: 12px;
    padding: 13px;
    border: 1px solid rgba(114, 201, 250, 0.28);
    border-radius: 6px;
    background: var(--blue-soft);
}

.bluetooth-printer-box strong,
.bluetooth-printer-box span {
    display: block;
}

.bluetooth-printer-box strong {
    font-size: 13px;
}

.bluetooth-printer-box span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.bluetooth-printer-box .checkbox-line {
    background: rgba(8, 13, 14, 0.44);
}

.ticket-preview-dialog {
    width: min(620px, calc(100vw - 28px));
}

.ticket-preview-stage {
    min-height: 280px;
    max-height: 62vh;
    display: grid;
    place-items: start center;
    padding: 20px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #dfe7e2;
}

.ticket-preview-stage .receipt {
    max-width: 100%;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.ticket-preview-stage[data-paper="58mm"] .receipt {
    width: 232px;
}

.page-load-line {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 120;
    width: 34%;
    height: 2px;
    pointer-events: none;
    background: var(--green);
    box-shadow: 0 0 16px rgba(131, 229, 47, 0.54);
    transform: translateX(-120%);
    animation: page-load 920ms var(--ease-out) both;
}

.motion-ready .reveal-item {
    opacity: 0;
    transform: translateY(14px);
}

.motion-ready .reveal-item.reveal-visible {
    animation: reveal-item 520ms var(--ease-out) both;
    animation-delay: calc(var(--reveal-order, 0) * 42ms);
}

.number-counting {
    color: var(--green);
}

@keyframes dialog-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(7px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes login-in {
    from {
        opacity: 0;
        transform: scale(1.015);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes login-content-in {
    from {
        opacity: 0;
        transform: translateX(-14px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scene-copy-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes reveal-item {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes page-load {
    0% {
        transform: translateX(-120%);
    }
    68% {
        transform: translateX(220%);
    }
    100% {
        transform: translateX(400%);
        opacity: 0;
    }
}

@keyframes logo-breathe {
    0%,
    100% {
        transform: translateY(0);
        box-shadow: 0 0 0 5px var(--green-soft), 0 14px 36px rgba(0, 0, 0, 0.4);
    }
    50% {
        transform: translateY(-2px);
        box-shadow: 0 0 0 7px rgba(131, 229, 47, 0.08), 0 18px 42px rgba(0, 0, 0, 0.46);
    }
}

@keyframes status-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 4px var(--green-soft);
    }
    50% {
        box-shadow: 0 0 0 7px rgba(131, 229, 47, 0.03);
    }
}

@keyframes stat-beacon {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.78);
    }
}

@keyframes active-nav-in {
    from {
        opacity: 0;
        transform: scaleY(0);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

@keyframes sidebar-signal {
    0%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(calc(100vh - 150px));
    }
}

@keyframes topbar-scan {
    0%,
    100% {
        opacity: 0.3;
        transform: translateX(0);
    }
    50% {
        opacity: 1;
        transform: translateX(-170px);
    }
}

@media (max-width: 1180px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sales-layout {
        grid-template-columns: minmax(0, 1fr) 340px;
    }

    .three-column {
        grid-template-columns: 1fr;
    }

    .order-board {
        grid-template-columns: repeat(4, 280px);
    }
}

@media (max-width: 940px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(300px, 86vw);
        transform: translateX(-102%);
        transition: transform 190ms ease;
        box-shadow: var(--shadow);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-scrim {
        position: fixed;
        inset: 0;
        z-index: 29;
        border: 0;
        background: rgba(0, 0, 0, 0.62);
        opacity: 0;
        pointer-events: none;
        transition: opacity 190ms ease;
    }

    .sidebar-scrim.open {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .menu-button {
        display: inline-flex;
    }

    .two-column,
    .security-layout {
        grid-template-columns: 1fr;
    }

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

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

    .cart-panel {
        position: static;
    }

    .login-shell {
        grid-template-columns: minmax(360px, 450px) minmax(0, 1fr);
        background-position: 58% center;
    }

    .login-access {
        padding: 28px 34px 36px;
    }

    .login-logo {
        width: 54px;
        height: 54px;
    }

    .login-identity strong {
        font-size: 20px;
    }

    .login-scene-copy {
        right: 30px;
        bottom: 30px;
    }
}

@media (max-width: 680px) {
    body {
        padding-bottom: 66px;
    }

    body.auth-body {
        padding-bottom: 0;
    }

    .topbar {
        min-height: 72px;
        padding: 11px 14px;
    }

    .topbar h1 {
        font-size: 20px;
    }

    .topbar-sale {
        display: none;
    }

    .connection-status {
        display: none;
    }

    .page {
        padding: 16px 12px 30px;
    }

    .page-intro {
        align-items: stretch;
        flex-direction: column;
        padding-bottom: 14px;
    }

    .page-intro h2 {
        font-size: 19px;
    }

    .page-intro .actions {
        width: 100%;
    }

    .page-intro .actions .button {
        flex: 1;
    }

    .report-intro .button {
        width: 100%;
    }

    .report-filter-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .report-range-presets {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-range-presets button {
        border-bottom: 1px solid var(--line);
    }

    .report-range-presets button:nth-child(2) {
        border-right: 0;
    }

    .report-range-presets button:nth-child(n + 3) {
        border-bottom: 0;
    }

    .report-flow-layout {
        gap: 18px;
    }

    .report-net-result {
        min-height: 142px;
        padding: 17px;
    }

    .report-net-result strong {
        font-size: 27px;
    }

    .report-box-grid {
        grid-template-columns: 1fr;
    }

    .report-result-badge {
        align-self: flex-start;
    }

    .stats-grid {
        gap: 9px;
    }

    .stat-card {
        min-height: 112px;
        padding: 15px;
    }

    .stat-card span {
        margin-bottom: 18px;
        font-size: 11px;
    }

    .stat-card strong {
        font-size: 21px;
    }

    .quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .quick-action {
        min-height: 66px;
        padding: 11px;
        font-size: 12px;
    }

    .panel {
        padding: 15px;
    }

    .panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .panel-header > .button {
        align-self: flex-start;
    }

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

    .span-2 {
        grid-column: auto;
    }

    .product-image-editor {
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .component-picker {
        grid-template-columns: 1fr;
    }

    .component-picker .button {
        width: 100%;
    }

    .product-image-preview {
        width: 110px;
    }

    .print-option-row {
        grid-template-columns: 1fr;
    }

    .print-option-row .button {
        width: 100%;
    }

    .app-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }

    .dialog-shell {
        max-height: calc(100vh - 16px);
        padding: 16px;
    }

    .dialog-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .dialog-actions .button {
        width: 100%;
    }

    .ticket-preview-stage {
        padding: 10px;
    }

    .span-2 {
        grid-column: span 1;
    }

    .filters label {
        min-width: calc(50% - 6px);
        flex: 1;
    }

    .search-input {
        max-width: none;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .product-button {
        min-height: 210px;
    }

    .cart-line {
        grid-template-columns: 1fr;
    }

    .cart-controls {
        justify-content: flex-end;
    }

    .flash-stack {
        top: 80px;
        right: 14px;
        left: 14px;
    }

    .flash {
        width: 100%;
    }

    .mobile-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 25;
        height: 66px;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        padding: 7px 8px max(7px, env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        background: rgba(8, 11, 12, 0.96);
        backdrop-filter: blur(16px);
    }

    .mobile-nav a,
    .mobile-nav button {
        position: relative;
        display: grid;
        place-items: center;
        border: 0;
        border-radius: 5px;
        background: transparent;
        color: var(--muted);
        font-size: 11px;
        font-weight: 750;
        transition: color 170ms ease, background 170ms ease, transform 170ms var(--ease-out);
    }

    .mobile-nav a:active,
    .mobile-nav button:active {
        transform: scale(0.95);
    }

    .mobile-nav a.active {
        background: var(--green-soft);
        color: var(--green);
    }

    .mobile-nav a.active::before {
        content: "";
        position: absolute;
        top: 0;
        width: 24px;
        height: 2px;
        border-radius: 0 0 2px 2px;
        background: var(--green);
        box-shadow: 0 0 10px rgba(131, 229, 47, 0.4);
        animation: active-nav-in 260ms var(--ease-out) both;
    }

    .operations-strip {
        grid-template-columns: 1fr;
    }

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

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

    .goal-values,
    .comparison-line,
    .restock-item,
    .reminder-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .order-board {
        grid-template-columns: repeat(4, min(82vw, 300px));
        scroll-snap-type: x proximity;
    }

    .order-column {
        scroll-snap-align: start;
    }

    .auth-page {
        min-height: 100svh;
    }

    .login-shell {
        min-height: 100svh;
        grid-template-columns: 1fr;
        background-position: 64% center;
    }

    .login-shell::after,
    .login-scene-copy {
        display: none;
    }

    .login-access {
        width: min(100%, 430px);
        min-height: 100svh;
        padding: 22px 22px max(28px, env(safe-area-inset-bottom));
        background: rgba(3, 8, 9, 0.87);
        backdrop-filter: blur(5px);
    }

    .login-identity {
        gap: 12px;
        padding-bottom: 19px;
    }

    .login-logo {
        width: 49px;
        height: 49px;
        border-width: 2px;
    }

    .login-identity strong {
        font-size: 19px;
    }

    .login-card {
        max-width: none;
        padding: 36px 0 18px;
    }

    .login-heading {
        margin-bottom: 24px;
    }

    .login-heading h1 {
        font-size: 30px;
    }
}

@media (max-width: 420px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        min-height: 96px;
    }

    .stat-card span {
        margin-bottom: 10px;
    }

    .product-button {
        min-height: 190px;
        grid-template-rows: 105px auto auto;
    }

    .product-art {
        height: 105px;
    }

    .filters label {
        min-width: 100%;
    }

    .login-identity p {
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    @page {
        size: 80mm auto;
        margin: 3mm;
    }

    body,
    .ticket-page {
        min-height: 0;
        margin: 0;
        padding: 0;
        display: block;
        background: #fff;
    }

    body::before {
        display: none;
    }

    .receipt {
        width: 74mm;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .receipt-actions {
        display: none;
    }
}
