﻿:root {
    --bg: #f2f5f9;
    --surface: #ffffff;
    --surface-muted: #eef2f7;
    --text: #0e1b2a;
    --muted: #5e6b7a;
    --accent: #0f3d75;
    --accent-2: #2c6cb0;
    --danger: #c0392b;
    --border: #dde3ed;
    --shadow: 0 18px 50px rgba(12, 30, 55, 0.12);
    --radius: 20px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    position: relative;
}

body.modal-open {
    overflow: hidden;
    height: 100%;
}

h1, h2, h3, h4 {
    font-family: "Sora", "Segoe UI", sans-serif;
    margin: 0 0 12px 0;
}

p {
    margin: 0 0 12px 0;
    color: var(--muted);
}

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

.bg-orb {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(0px);
    opacity: 0.35;
    z-index: 0;
}

.orb-1 {
    top: -120px;
    left: -120px;
    background: radial-gradient(circle, rgba(15, 61, 117, 0.45), transparent 65%);
}

.orb-2 {
    bottom: -160px;
    right: -160px;
    background: radial-gradient(circle, rgba(44, 108, 176, 0.45), transparent 65%);
}

.bg-lines {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(120deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.topbar {
    position: relative;
    z-index: 5;
    display: grid;
    justify-items: center;
    align-items: center;
    gap: 18px;
    padding: 18px 8vw 10px;
    background: transparent;
}

.brand {
    display: grid;
    place-items: center;
    gap: 6px;
    text-align: center;
}

.brand-logo {
    width: min(260px, 70vw);
    height: auto;
    display: block;
    filter: drop-shadow(0 12px 28px rgba(12, 30, 55, 0.18));
}

.nav {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(12, 30, 55, 0.08);
}

.nav-link {
    font-size: 17px;
    color: var(--muted);
    padding: 8px 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: var(--text);
    border-bottom: 2px solid var(--accent);
}

.container {
    position: relative;
    padding: 40px 8vw 80px;
}

.hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    align-items: center;
    margin-bottom: 40px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 12px;
    color: var(--accent);
}

.lead {
    font-size: 18px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.hero-card {
    background: var(--surface);
    padding: 26px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
}

.hero-stat {
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
}

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

.card-link {
    background: var(--surface);
    padding: 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 160px;
}

.card-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 50px rgba(31, 30, 24, 0.15);
}

.card-action {
    color: var(--accent);
    font-weight: 600;
    margin-top: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-emphasis {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a2b40;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.panel {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.filter-panel {
    display: grid;
    gap: 14px;
    border: 1px solid rgba(15, 61, 117, 0.08);
    background: linear-gradient(135deg, rgba(15, 61, 117, 0.04), rgba(255, 255, 255, 0.9));
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.catalog-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.search-input {
    min-width: 220px;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: white;
}

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

.filter-form {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(200px, 1fr) 1fr auto;
    gap: 14px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
}

.filter-chips {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.view-toggle {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
}

.view-options {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.view-option {
    position: relative;
    cursor: pointer;
}

.view-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.view-pill {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(15, 61, 117, 0.16);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 18px rgba(12, 30, 55, 0.06);
    color: #0f3d75;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.view-pill span {
    font-size: 12px;
    color: var(--muted);
}

.view-option input:checked + .view-pill {
    border-color: #0f3d75;
    background: #0f3d75;
    color: white;
    box-shadow: 0 10px 22px rgba(15, 61, 117, 0.22);
    transform: translateY(-1px);
}

.view-option input:checked + .view-pill span {
    color: rgba(255, 255, 255, 0.78);
}

.filter-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
}

.chip {
    border-radius: 999px;
    padding: 8px 14px;
    border: 1px solid rgba(15, 61, 117, 0.25);
    background: rgba(15, 61, 117, 0.08);
    color: #0f3d75;
    font-weight: 600;
    cursor: pointer;
}

.chip:hover {
    background: rgba(15, 61, 117, 0.16);
    border-color: rgba(15, 61, 117, 0.45);
}

.chip.active {
    background: rgba(15, 61, 117, 0.2);
    border-color: #0f3d75;
}

.form-inline {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

.stock-movement-form {
    grid-template-columns: minmax(220px, 1.4fr) minmax(140px, 0.7fr) minmax(140px, 0.7fr) minmax(220px, 1fr);
    column-gap: 20px;
    row-gap: 18px;
}

.stock-movement-form label {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.stock-movement-form label span {
    margin-bottom: 8px;
}

.stock-movement-form button[type="submit"] {
    grid-column: 1 / -1;
    justify-self: end;
    margin-top: 2px;
}

.form-inline label {
    min-width: 0;
}

.form-inline button[type="submit"] {
    grid-column: 1 / -1;
    justify-self: end;
}

label span,
.form-group span {
    display: block;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 6px;
}

.form-group {
    display: grid;
    gap: 10px;
}

.form-error {
    color: #c0392b;
    font-weight: 600;
    margin-top: 4px;
}

input, select, button, textarea {
    font-family: inherit;
    font-size: 15px;
}

input, select, textarea {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: white;
}

input[type="file"] {
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    width: 100%;
    min-height: 44px;
    max-width: 100%;
    display: block;
}

input[type="file"]::file-selector-button {
    margin-right: 16px;
    padding: 8px 14px;
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    font-weight: 600;
    cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
    background: #0b2e57;
}

input[type="file"]::-webkit-file-upload-button {
    margin-right: 16px;
    padding: 8px 14px;
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    font-weight: 600;
    cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: #0b2e57;
}

button, .primary, .secondary, .ghost, .danger {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.primary {
    background: var(--accent);
    color: white;
}

.primary:hover {
    background: #0b2e57;
}

.secondary {
    background: var(--surface-muted);
    color: var(--text);
}

.secondary:hover {
    background: #dfe6f0;
}

.ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}

.ghost:hover {
    color: var(--text);
    border-color: #c7d0de;
    background: rgba(15, 61, 117, 0.06);
}

.danger {
    background: var(--danger);
    color: white;
}

.danger:hover {
    background: #a93226;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    align-items: start;
}

.stock-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    max-height: calc(4 * 180px + 3 * 18px);
    overflow: auto;
    padding-right: 6px;
}

.stock-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-muted);
    position: relative;
}

.stock-card img {
    width: 86px;
    height: 86px;
    border-radius: 14px;
    object-fit: cover;
}

.btn-history {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);

    border: 1px solid rgba(15, 61, 117, 0.35);
    color: #0f3d75;
    background: rgba(15, 61, 117, 0.08);
    font-weight: 700;
}

.btn-history:hover {
    border-color: #0f3d75;
    background: rgba(15, 61, 117, 0.16);
}

.btn-link-card {
    border: 1px solid rgba(44, 108, 176, 0.6);
    color: #1a3a6b;
    background: rgba(44, 108, 176, 0.12);
    font-weight: 700;
}

.btn-link-card:hover {
    border-color: #2c6cb0;
    background: rgba(44, 108, 176, 0.2);
}

.btn-unlink-card {
    border: 1px solid rgba(192, 57, 43, 0.6);
    color: #c0392b;
    background: rgba(192, 57, 43, 0.08);
    font-weight: 700;
}

.btn-unlink-card:hover {
    border-color: #c0392b;
    background: rgba(192, 57, 43, 0.16);
}

.variant-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: grid;
    gap: 6px;
}

.variant-list li {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

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

.profile-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    background: var(--surface-muted);
}

.inline-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

#profile-card-number {
    flex: 1 1 240px;
    min-width: 200px;
}

#profile-card-suffix {
    width: 72px;
    text-align: center;
    letter-spacing: 2px;
}

#assign-card-suffix {
    width: 96px;
    text-align: center;
    letter-spacing: 2px;
}

.card-pattern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-muted);
    font-weight: 600;
    color: var(--text);
}

.card-pattern input {
    width: 56px;
    padding: 8px 6px;
    text-align: center;
    letter-spacing: 2px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: white;
}

.btn-clear-outline {
    background: transparent;
    border: 1px solid rgba(192, 57, 43, 0.45);
    color: #c0392b;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 700;
}

.btn-clear-outline:hover {
    border-color: #c0392b;
    background: rgba(192, 57, 43, 0.08);
}

.card-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

#profile-card-warning {
    color: #c0392b;
    font-weight: 600;
    margin-top: 6px;
}

.profile-actions {
    display: grid;
    gap: 10px;
}

.variant-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.variant-row-fields {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.7fr;
    gap: 8px;
    width: 100%;
}

.variant-row-fields-edit {
    grid-template-columns: 1.2fr 1fr 0.7fr;
}

.variant-row-fields input,
.variant-row-fields-edit input {
    min-width: 0;
}

#edit-variants-list .variant-row {
    grid-template-columns: 1fr auto;
    align-items: center;
}

#edit-variants-list .variant-row button {
    justify-self: center;
}

.variants {
    border: 1px dashed var(--border);
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.variants-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 18px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.stat-card button {
    border: none;
    text-align: left;
    width: 100%;
    padding: 0;
    background: transparent;
}

.stat-card.prepaid-card {
    appearance: none;
    border: none;
    text-align: left;
    width: 100%;
    padding: 18px;
    display: grid;
    gap: 6px;
    background: var(--surface);
    justify-content: start;
    align-content: start;
    justify-items: start;
    align-items: start;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card.prepaid-card small {
    color: var(--muted);
    font-weight: 500;
}

.stat-card.prepaid-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(12, 30, 55, 0.16);
}

.prepaid-list {
    display: grid;
    gap: 12px;
    margin-top: 12px;
    max-height: 320px;
    overflow-y: auto;
}

.prepaid-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 61, 117, 0.06);
}

.prepaid-row .muted {
    display: block;
    font-size: 12px;
}

.stat-card.highlight {
    background: var(--accent);
    color: white;
}

.table-wrapper {
    overflow-x: auto;
}

.table-scroll {
    max-height: 420px;
    overflow-y: scroll;
}

.table-scroll-cash {
    max-height: 340px;
    overflow-y: scroll;
}

.danger-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(192, 57, 43, 0.2);
    background: rgba(192, 57, 43, 0.06);
}

.status-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.status-panel span {
    color: var(--muted);
}

.status-panel.success {
    border: 1px solid rgba(46, 204, 113, 0.25);
    background: rgba(46, 204, 113, 0.08);
}

.status-panel.danger {
    border: 1px solid rgba(192, 57, 43, 0.25);
    background: rgba(192, 57, 43, 0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    text-align: left;
    background: var(--surface-muted);
}

th, td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.sales-layout {
    display: grid;
    grid-template-columns: minmax(320px, 1.4fr) minmax(280px, 1fr);
    gap: 24px;
}

.product-scroll {
    overscroll-behavior: contain;
    max-height: calc(3 * 310px + 2 * 16px);
    overflow-y: auto;
    padding-right: 6px;
    overflow-anchor: none;
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
    will-change: transform;
    scrollbar-gutter: stable;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.catalog-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    height: 310px;
    transform: translateZ(0);
    will-change: transform;
}

.catalog-thumb {
    width: 100%;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-thumb img {
    width: 110px;
    height: 110px;
    border-radius: 14px;
    object-fit: cover;
    background: white;
    display: block;
}

.catalog-info {
    display: grid;
    gap: 6px;
    flex: 1;
    align-content: start;
    overflow: hidden;
}

.catalog-info h4 {
    font-size: 15px;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.catalog-info strong {
    font-size: 14px;
}

.catalog-info .stock-badge {
    font-size: 13px;
    color: var(--muted);
}

.catalog-info .badge-variants {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
}

.catalog-actions {
    margin-top: auto;
}

.catalog-actions button {
    width: 100%;
    height: 44px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.badge-info {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(18, 63, 120, 0.1);
    color: #123f78;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 12px;
    animation: badgePulse 2.4s ease-in-out infinite;
}

.badge-alert {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(192, 57, 43, 0.12);
    color: #c0392b;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 12px;
    animation: badgePulse 2.4s ease-in-out infinite;
}

.balance-waiting {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

@keyframes badgePulse {
    0% {
        opacity: 0.75;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-1px);
    }
    100% {
        opacity: 0.75;
        transform: translateY(0);
    }
}

.btn-disabled {
    background: #c04a4a;
    color: #f6f7fb;
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-disabled:hover {
    background: #c04a4a;
}

.variant-modal-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.variant-modal-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-muted);
}

.variant-modal-item .variant-meta {
    display: grid;
    gap: 4px;
}

.catalog-info h4 {
    margin: 0;
}

.cart-items {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
    max-height: calc(3 * 300px + 2 * 16px);
    overflow: auto;
    padding-right: 6px;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
}

.cart-item input {
    width: 70px;
}

.cart-controls {
    display: grid;
    gap: 6px;
    align-items: center;
    justify-items: end;
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.payment-panel {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--border);
}

.cash-summary {
    display: grid;
    gap: 14px;
    margin-top: 8px;
}

.cash-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--surface-muted);
    border-radius: var(--radius-sm);
}

.cash-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cash-shortcuts button {
    min-width: 96px;
}

.cash-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.btn-clear-danger {
    border: 1px solid rgba(192, 57, 43, 0.7);
    color: #c0392b;
    background: rgba(192, 57, 43, 0.12);
    font-weight: 700;
}

.btn-clear-danger:hover {
    border-color: #c0392b;
    background: rgba(192, 57, 43, 0.2);
}

.btn-link-profile {
    border: 1px solid rgba(15, 61, 117, 0.4);
    color: #0f3d75;
    background: rgba(15, 61, 117, 0.12);
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(15, 61, 117, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-link-profile:hover {
    border-color: #0f3d75;
    background: rgba(15, 61, 117, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(15, 61, 117, 0.18);
}
.profile-link-list {
    display: grid;
    gap: 12px;
    margin-top: 12px;
    max-height: calc(5 * 64px + 4 * 12px);
    overflow: auto;
}

.profile-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    min-height: 64px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-muted);
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-link-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(12, 30, 55, 0.12);
}

.cash-change.negative {
    color: var(--danger);
}

.payment-options {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.option input[type="radio"] {
    margin: 0;
    transform: translateY(0);
}

.option span {
    line-height: 1.1;
}

.payment-options .option {
    min-height: 28px;
}

.payment-options .option span {
    display: inline-flex;
    align-items: center;
}

.prepaid-panel {
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    margin-bottom: 14px;
}

.prepaid-info {
    margin-bottom: 10px;
}

.hidden {
    display: none;
}

.pill {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-muted);
    font-size: 12px;
}

.pill-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
}

.pill-status.credit {
    background: rgba(39, 174, 96, 0.12);
    color: #1e7e4f;
}

.pill-status.debit {
    background: rgba(192, 57, 43, 0.12);
    color: #a93226;
}

.pill-status.sale {
    background: rgba(15, 61, 117, 0.12);
    color: #0f3d75;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(18, 18, 16, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal.open {
    display: flex;
    opacity: 1;
}

.modal-card {
    transform: translateY(8px) scale(0.98);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.modal.open .modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal.closing {
    opacity: 0;
}

.modal.closing .modal-card {
    transform: translateY(8px) scale(0.98);
    opacity: 0;
}

.modal-card {
    background: var(--surface);
    padding: 22px;
    border-radius: var(--radius);
    width: min(480px, 92vw);
    box-shadow: var(--shadow);
}

.modal-card-wide {
    width: min(840px, 94vw);
    max-height: 80vh;
    overflow-x: hidden;
    overflow-y: scroll;
}

.stock-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: white;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.icon-btn img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.icon-btn:hover {
    background: var(--surface-muted);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.modal-footer {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
}

.modal-footer.equal-buttons > * {
    flex: 1;
}

.modal-footer.equal-buttons button {
    width: 100%;
}

.modal-footer.equal-buttons form {
    margin: 0;
}

.icon-button {
    background: transparent;
    font-size: 22px;
    border: none;
    cursor: pointer;
}

.scan-body {
    display: grid;
    place-items: center;
    padding: 20px 0;
    gap: 12px;
}

.scan-pulse {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 61, 117, 0.35), rgba(15, 61, 117, 0.05));
    position: relative;
}

.scan-pulse::after {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    border: 2px dashed rgba(15, 61, 117, 0.45);
    animation: pulse 2.4s infinite ease-in-out;
}

.scan-status {
    font-weight: 600;
    color: var(--accent);
}

.scan-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.success-body {
    margin-top: 12px;
    display: grid;
    gap: 12px;
}

.success-card {
    border: 1px solid var(--border);
    background: var(--surface-muted);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.empty-state {
    text-align: center;
    padding: 40px 10px;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.7; }
    70% { transform: scale(1.15); opacity: 0.2; }
    100% { transform: scale(1); opacity: 0.7; }
}

@media (max-width: 900px) {
    .sales-layout {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 16px 6vw 10px;
    }

    .brand-logo {
        width: min(220px, 80vw);
    }

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

    .product-grid {
        grid-template-columns: 1fr;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }
}

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

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

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

.check-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-inline .check-text {
    display: inline;
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

.profile-actions a {
    text-decoration: none;
}


.profile-actions > * {
    width: 100%;
}


.nav-link.active {
    color: var(--text);
    border-bottom: 2px solid var(--accent);
    font-weight: 600;
}
