* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #f5f6f8;
    color: #222;
    line-height: 1.5;
}

a {
    color: inherit;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.topbar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 20px;
}

.topbar-inner {
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

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

.brand {
    font-size: 24px;
    font-weight: 700;
}

.card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

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

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.stat {
    font-size: 28px;
    font-weight: 700;
}

.small-stat {
    font-size: 22px;
}

.no-margin {
    margin: 0;
}

h1,
h2,
h3 {
    margin-top: 0;
    margin-bottom: 14px;
}

p {
    margin-top: 0;
}

.muted {
    color: #666;
    font-size: 14px;
}

.small-text {
    font-size: 12px;
}

.success {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.error {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

table th,
table td {
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
}

table th {
    background: #f9fafb;
    font-weight: 700;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #cfd4dc;
    border-radius: 8px;
    outline: none;
    background: #fff;
    font-size: 16px;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: #111;
}

.btn {
    display: inline-block;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-size: 15px;
}

.btn:hover {
    opacity: 0.92;
}

.btn-danger {
    background: #b91c1c;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

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

.form-submit {
    display: flex;
    align-items: end;
}

.form-actions {
    margin-top: 14px;
}

.divider {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 22px 0;
}

.actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.right {
    text-align: right;
}

.product-box {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    background: #fafafa;
}

.product-box-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.product-box-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    flex: 1;
}

.product-box-side {
    min-width: 80px;
    text-align: right;
}

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

.ingredient-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
}

.ingredient-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
}

.admin-delete-products {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.mini-delete-form {
    margin: 0;
}

.pos-container {
    max-width: 1500px;
}

.hotkey-card {
    padding: 16px;
}

.hotkey-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.hotkey-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.hotkey-input {
    width: 220px !important;
    font-size: 28px !important;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    padding: 16px 18px !important;
}

.pos-btn {
    min-height: 60px;
    min-width: 130px;
    font-size: 20px;
    font-weight: 700;
}

.pos-layout {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 18px;
    align-items: start;
}

.product-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.product-button-form {
    margin: 0;
}

.product-big-btn {
    width: 100%;
    min-height: 170px;
    border: none;
    border-radius: 18px;
    background: #111827;
    color: #fff;
    cursor: pointer;
    padding: 18px;
    text-align: left;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.product-big-btn:hover {
    opacity: 0.95;
}

.product-hotkey {
    display: inline-block;
    min-width: 44px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
}

.product-title {
    font-size: 30px;
    line-height: 1.15;
    font-weight: 700;
    margin-bottom: 10px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.product-price {
    font-size: 22px;
    opacity: 0.95;
}

.sticky-cart {
    position: sticky;
    top: 16px;
}

.cart-summary-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.cart-summary-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
}

.cart-total-text {
    font-size: 22px;
}

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    background: #fafafa;
}

.cart-item-main {
    margin-bottom: 10px;
}

.cart-item-name {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.cart-hotkey-tag {
    display: inline-block;
    margin-left: 8px;
    font-size: 14px;
    background: #111827;
    color: #fff;
    padding: 4px 8px;
    border-radius: 999px;
    vertical-align: middle;
}

.cart-item-meta {
    color: #666;
    font-size: 15px;
    margin-top: 4px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.qty-btn {
    width: 62px;
    height: 62px;
    border: none;
    border-radius: 12px;
    background: #111827;
    color: #fff;
    font-size: 34px;
    cursor: pointer;
}

.qty-view {
    min-width: 70px;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
}

.cart-line-total {
    font-size: 22px;
    font-weight: 700;
}

.checkout-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.big-action-btn {
    width: 100%;
    min-height: 86px;
    font-size: 28px;
    font-weight: 700;
    border-radius: 16px;
}

.sales-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sale-box {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    background: #fafafa;
}

.sale-box-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.sale-title {
    font-size: 22px;
    font-weight: 700;
}

.sale-head-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.sale-sum {
    font-size: 22px;
    font-weight: 700;
}

.sale-subgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.sale-mini-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
}

.sale-section {
    margin-top: 14px;
}

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

    .sticky-cart {
        position: static;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 14px;
    }

    .card {
        padding: 14px;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    .brand {
        font-size: 20px;
    }

    .stat {
        font-size: 24px;
    }

    .product-box-side {
        text-align: left;
    }

    .product-title {
        font-size: 24px;
    }

    .product-price {
        font-size: 18px;
    }

    .cart-item-name {
        font-size: 18px;
    }

    .qty-btn {
        width: 54px;
        height: 54px;
        font-size: 28px;
    }

    .big-action-btn {
        min-height: 72px;
        font-size: 22px;
    }

    .hotkey-input {
        width: 160px !important;
        font-size: 24px !important;
    }

    .sale-title,
    .sale-sum {
        font-size: 18px;
    }
}