:root {
    --citty-orange: #f47b20;
    --citty-orange-dark: #c95f12;
    --citty-green: #0b7a75;
    --citty-gold: #f2b705;
    --citty-red: #d94841;
    --ink: #17202a;
    --soft: #f5f7f6;
    --line: #e6ecea;
}

body {
    background: var(--soft);
    color: var(--ink);
}

.app-nav {
    background: linear-gradient(90deg, var(--citty-orange), #e86d1c);
    box-shadow: 0 8px 24px rgba(23, 32, 42, .12);
}

.app-nav .container-fluid {
    gap: 10px;
}

.app-nav .navbar-brand,
.app-nav .nav-link,
.app-nav .navbar-toggler {
    color: #fff;
}

.app-nav .navbar-toggler {
    border-color: rgba(255, 255, 255, .35);
}

.app-nav .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.94%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.app-home-link {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, .12);
}

.app-home-link svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.app-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    min-width: 0;
    max-width: min(56vw, 440px);
    margin-right: auto;
    white-space: normal;
}

.app-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-brand small {
    color: rgba(255, 255, 255, .86);
    font-size: .72rem;
    font-weight: 500;
    line-height: 1.25;
}

.app-brand b {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-weight: 700;
}

.app-shell {
    max-width: 1180px;
}

.login-wrap {
    min-height: calc(100vh - 90px);
    display: grid;
    place-items: center;
}

.login-panel,
.panel,
.metric,
.sale-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(23, 32, 42, .05);
}

.login-panel {
    width: min(440px, 100%);
    padding: 24px;
}

.brand-mark {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--citty-orange);
    color: #fff;
    font-weight: 800;
    margin-bottom: 16px;
}

.btn-primary {
    background: var(--citty-orange);
    border-color: var(--citty-orange);
}

.btn-primary:hover {
    background: var(--citty-orange-dark);
    border-color: var(--citty-orange-dark);
}

.btn-primary:disabled {
    background: #b9c1bf;
    border-color: #b9c1bf;
}

.institutional-line {
    color: var(--citty-orange-dark);
    font-weight: 700;
    margin-bottom: 4px;
}

.quick-hero {
    background: linear-gradient(120deg, var(--citty-orange), #0b7a75);
    color: #fff;
    border-radius: 8px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.metric {
    padding: 16px;
    min-height: 96px;
}

.metric span {
    display: block;
    color: #63716d;
    font-size: .9rem;
}

.metric strong {
    display: block;
    font-size: clamp(1.35rem, 4vw, 2rem);
    line-height: 1.15;
}

.panel {
    padding: 16px;
}

.panel small,
td small {
    display: block;
    color: #6b7875;
}

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

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #edf1f0;
    text-decoration: none;
    color: inherit;
}

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

.list-row small {
    display: block;
    color: #6b7875;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    padding-bottom: 270px;
}

.sale-search {
    margin-bottom: 10px;
}

.sale-search .form-control {
    border-color: #f2d8c4;
    box-shadow: 0 6px 18px rgba(244, 123, 32, .08);
}

.empty-products-message {
    background: #fff;
    border: 1px dashed #f2d8c4;
    border-radius: 8px;
    color: #6b7875;
    margin-bottom: 12px;
    padding: 14px;
    text-align: center;
}

.sale-card {
    padding: 14px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.sale-card.is-selected {
    border-color: rgba(244, 123, 32, .55);
    box-shadow: 0 10px 28px rgba(244, 123, 32, .13);
}

.sale-card strong,
.sale-card small,
.sale-card span {
    display: block;
}

.sale-card span {
    color: var(--citty-orange-dark);
    font-weight: 700;
}

.qty-control {
    display: grid;
    grid-template-columns: 44px 48px 44px;
    align-items: center;
    gap: 4px;
}

.qty-control input {
    width: 48px;
    height: 44px;
    text-align: center;
    border: 1px solid #d6dfdc;
    border-radius: 8px;
    font-weight: 700;
}

.checkout-bar {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, .98);
    border: 1px solid #f0ded1;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -10px 30px rgba(23, 32, 42, .08);
    padding: 12px 0;
    margin-top: 12px;
}

.checkout-bar .row {
    margin-left: 0;
    margin-right: 0;
    padding: 0 12px;
}

.checkout-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
    padding: 0 12px;
}

.checkout-summary div {
    background: #fff8f2;
    border: 1px solid #f2d8c4;
    border-radius: 8px;
    padding: 10px;
}

.checkout-summary span {
    display: block;
    color: #6b7875;
    font-size: .8rem;
}

.checkout-summary strong {
    display: block;
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.15;
}

.checkout-summary .checkout-total {
    background: var(--citty-orange);
    border-color: var(--citty-orange);
}

.checkout-summary .checkout-total span,
.checkout-summary .checkout-total strong {
    color: #fff;
}

.sale-list-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 14px 0;
    border-bottom: 1px solid #edf1f0;
}

.sale-list-item a {
    color: inherit;
    text-decoration: none;
}

.sale-list-item small {
    display: block;
    color: #6b7875;
}

.adjust-form {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 120px 1fr 110px auto;
    gap: 6px;
}

.receipt-body {
    background: #fff;
}

.receipt {
    width: 320px;
    margin: 0 auto;
    padding: 14px;
    font-family: Arial, sans-serif;
    color: #111;
}

.receipt h1 {
    font-size: 18px;
    text-align: center;
    color: var(--citty-orange-dark);
}

.receipt-brand {
    text-align: center;
    font-weight: 700;
}

.receipt p {
    font-size: 12px;
    margin: 6px 0;
}

.receipt table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.receipt th,
.receipt td {
    border-bottom: 1px dashed #999;
    padding: 4px 2px;
    text-align: right;
}

.receipt th:first-child,
.receipt td:first-child {
    text-align: left;
}

.receipt-totals {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px;
    font-size: 12px;
}

.legend {
    border-top: 1px dashed #999;
    padding-top: 8px;
    text-align: center;
}

.print-btn {
    width: 100%;
    padding: 12px;
    border: 0;
    border-radius: 8px;
    background: var(--citty-orange);
    color: #fff;
    font-weight: 700;
}

.receipt-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.receipt-link {
    display: block;
    width: 100%;
    padding: 11px;
    border: 1px solid #d9e1df;
    border-radius: 8px;
    color: var(--ink);
    text-align: center;
    text-decoration: none;
    font-weight: 700;
}

.receipt-link.primary {
    border-color: var(--citty-orange);
    color: var(--citty-orange-dark);
    background: #fff8f2;
}

@media (max-width: 640px) {
    .app-nav .container-fluid {
        align-items: center;
    }

    .app-home-link {
        width: 40px;
        height: 40px;
    }

    .app-brand {
        max-width: calc(100vw - 118px);
    }

    .app-brand span {
        font-size: 1rem;
    }

    .app-brand small {
        font-size: .68rem;
    }

    .app-brand b {
        margin-left: 0;
        margin-top: 3px;
    }

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

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

    .quick-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .checkout-summary {
        grid-template-columns: 1fr;
    }
}

@media print {
    .receipt-actions,
    .print-btn {
        display: none;
    }

    .receipt {
        margin: 0;
        width: 100%;
    }
}
