* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #000;
    overflow-x: hidden;
}

.view {
    display: none;
    min-height: 100vh;
    padding-bottom: 0;
    position: relative;
}

#productsView {
    padding-bottom: 0;
}

.view.active {
    display: block;
}

.header {
    background: white;
    padding: 12px 16px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid #e0e0e0;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.header p {
    font-size: 12px;
    color: #888;
    margin: 2px 0 0 0;
}

.btn-back {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #0088cc;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
}

.btn-done {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #0088cc;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
}

.section-title {
    padding: 16px;
    font-weight: 600;
    font-size: 16px;
}

.products-grid {
    padding: 0 16px;
    padding-bottom: 90px; /* Space for fixed buttons at bottom */
    overflow-x: auto;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    position: relative;
    scroll-behavior: smooth;
    scroll-padding-bottom: 0;
}

.products-table {
    width: 100%;
    max-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    table-layout: auto;
}

.products-table thead.table-header-sticky {
    background: #e3f2fd;
}

.products-table thead.table-header-sticky tr {
    background: #e3f2fd;
}

.products-table thead.table-header-sticky th {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 10;
    background: #e3f2fd !important;
    border-bottom: 2px solid #ddd;
    box-sizing: border-box;
}

.products-table th {
    padding: 12px 5px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
    background: #e3f2fd;
    line-height: 1.4;
    box-sizing: border-box;
}

/* Sticky first column (image) */
.products-table thead.table-header-sticky th:first-child {
    width: 60px;
    padding-right: 5px;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 12;
    background: #e3f2fd !important;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

/* Hide scrolling content behind first column header */
.products-table thead.table-header-sticky th:first-child::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100vw;
    width: 100vw;
    height: 100%;
    background: #e3f2fd;
    z-index: -1;
    pointer-events: none;
}

/* Sticky second column (Name) */
.products-table thead.table-header-sticky th:nth-child(2) {
    text-align: left;
    padding-left: 12px;
    padding-right: 5px;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    left: 60px;
    z-index: 12;
    background: #e3f2fd !important;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

/* Size columns (S, M, L, XL, XXL) - narrow width */
.products-table th:nth-child(3),
.products-table th:nth-child(4),
.products-table th:nth-child(5),
.products-table th:nth-child(6),
.products-table th:nth-child(7) {
    width: 50px;
    padding: 12px 2.5px;
}

.products-table th:nth-child(8) {
    padding-left: 5px;
    padding-right: 5px;
}

.products-table th:nth-child(9) {
    padding-left: 5px;
    padding-right: 5px;
}

.products-table th:nth-child(10) {
    padding-left: 5px;
    padding-right: 5px;
}

.products-table td {
    padding: 12px 5px;
    text-align: center;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

/* Sticky first column (image) */
.products-table td:first-child {
    width: 60px;
    padding: 8px 5px;
    position: -webkit-sticky;
    position: sticky;
    left: 0;
    z-index: 2;
    background: white !important;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

/* Hide scrolling content behind first column cells */
.products-table td:first-child::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100vw;
    width: 100vw;
    height: 100%;
    background: white;
    z-index: -1;
    pointer-events: none;
}

/* Sticky second column (Name) */
.products-table td:nth-child(2) {
    text-align: left;
    padding-left: 12px;
    padding-right: 5px;
    font-weight: 500;
    position: -webkit-sticky;
    position: sticky;
    left: 60px;
    z-index: 2;
    background: white !important;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.table-total-row td:first-child,
.table-total-row td:nth-child(2) {
    background: #f5f5f5 !important;
    z-index: 7;
}

/* Hide scrolling content behind Total row first column */
.table-total-row td:first-child::after {
    background: #f5f5f5 !important;
}

/* Size columns (S, M, L, XL, XXL) - narrow width with 5px spacing */
.products-table td.size-cell {
    width: 50px;
    min-width: 50px;
    padding: 8px 2.5px;
}

.products-table td.total-quantity-cell-large {
    width: auto;
    min-width: 250px;
    padding: 8px;
    text-align: center;
}

.total-quantity-input-large {
    width: 100%;
    padding: 8px;
    font-size: 16px;
    text-align: center;
    border: 2px solid #007bff;
    border-radius: 4px;
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.total-quantity-input-large::-webkit-inner-spin-button,
.total-quantity-input-large::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.total-quantity-input-large:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.products-table td:nth-child(8) {
    padding-left: 5px;
    padding-right: 5px;
}

.products-table td:nth-child(9) {
    padding-left: 5px;
    padding-right: 5px;
}

.products-table td:nth-child(10) {
    padding-left: 5px;
    padding-right: 5px;
}

.product-image-cell {
    padding: 8px !important;
}

.product-image-container {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.product-table-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-table-emoji {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.size-cell {
    width: 50px;
    min-width: 50px;
    padding: 8px 2.5px;
}

.size-inventory {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
}

.size-controls {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-size-minus,
.btn-size-plus {
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.btn-size-minus:hover:not(:disabled),
.btn-size-plus:hover:not(:disabled) {
    background: #f0f0f0;
}

.btn-size-minus:disabled,
.btn-size-plus:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.size-quantity {
    min-width: 20px;
    font-weight: 500;
}

/* Category header row */
.category-header-row {
    background: #f5f5f5;
    position: -webkit-sticky;
    position: sticky;
    top: 86px; /* Position below table header (43px) + total row (43px) = 86px */
    z-index: 5;
}

.category-header-cell {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 16px;
    color: #333;
    border-bottom: 2px solid #ddd;
    border-top: 2px solid #ddd;
    background: #f5f5f5;
}

.size-quantity-input {
    width: 45px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
    font-size: 14px;
    font-weight: 500;
}

.size-quantity-input:focus {
    outline: none;
    border-color: #0088cc;
    background-color: #f0f8ff;
}

.size-quantity-input.quantity-exceeds {
    color: #d32f2f;
    border-color: #d32f2f;
    background-color: #ffebee;
    font-weight: 600;
}

.size-quantity-input.quantity-exceeds:focus {
    border-color: #d32f2f;
    background-color: #ffebee;
}

.size-quantity-input::-webkit-inner-spin-button,
.size-quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.size-quantity-input[type=number] {
    -moz-appearance: textfield;
}

/* Sticky total row - positioned right below header, flush with header */
.table-total-row.table-total-sticky {
    position: sticky;
    /* Height calculation: padding-top (12px) + line-height (~17px for font-size 12px with line-height 1.4) + padding-bottom (12px) + border-bottom (2px) = ~43px */
    top: 43px; /* Stick directly below header row */
    z-index: 9;
    border-top: none;
    border-bottom: 2px solid #ddd;
    background: #f5f5f5;
    margin-top: 0;
}

.table-total-row.table-total-sticky td {
    background: #f5f5f5 !important;
    font-weight: 600;
}

/* Hide scrolling content below Total row - removed pseudo-element to prevent extra spacing when keyboard opens */

.table-total-row td {
    background: #f5f5f5 !important;
    font-weight: 600;
}

.table-total-row td.total-price-sticky {
    background: #f5f5f5 !important;
    z-index: 6;
}

.total-row-label {
    text-align: left !important;
    padding-left: 12px !important;
}

/* Last column (Total,$) - no longer sticky */
.products-table th:last-child {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.products-table td:last-child {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.total-price-sticky-bottom {
    background: #f5f5f5 !important;
    z-index: 6 !important;
}

/* Order buttons container */
.order-buttons-container {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 16px;
    margin: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.order-buttons-container button {
    flex: 1;
}

/* Clear Cart button */
.btn-clear-cart {
    flex: 1;
    width: 50%;
    background: #f44336;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
}

.btn-clear-cart:hover {
    background: #d32f2f;
}

.btn-clear-cart:active {
    background: #b71c1c;
}

/* Export to Excel button */
.btn-export-excel {
    flex: 1;
    width: 50%;
    background: #4caf50;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
}

.btn-export-excel:hover {
    background: #45a049;
}

.btn-export-excel:active {
    background: #3d8b40;
}

/* Place Order button */
.btn-place-order {
    flex: 1;
    width: 50%;
    background: #0088cc;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
    position: relative;
    z-index: 10;
}

/* Sticky Place Order button */
.btn-place-order-sticky {
    position: relative;
}

.btn-place-order:hover {
    background: #0077b3;
}

.btn-place-order:active {
    background: #006699;
}

.total-cell,
.price-cell,
.total-price-cell {
    font-weight: 600;
    color: #333;
}

.total-price-cell {
    color: #0088cc;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    overflow: hidden;
    position: relative;
}

.product-image-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.product-image-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    width: 100%;
    height: 100%;
}

.product-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

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

.product-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add {
    background: #ff6b00;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
}

.btn-quantity {
    background: #f0f0f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-quantity.minus {
    background: #ff4444;
    color: white;
}

.btn-quantity.plus {
    background: #ff6b00;
    color: white;
}

.quantity-display {
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.cart-summary {
    padding: 0 16px;
    margin-bottom: 16px;
}

.cart-preview {
    background: white;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}

.cart-item-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.cart-item-preview:last-child {
    margin-bottom: 0;
}

.btn-view-order {
    background: #4caf50;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
}

.order-items {
    background: white;
    margin: 0 16px;
    border-radius: 12px;
    padding: 16px;
}

.order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-item-image-container {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.order-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-item-emoji {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-item-name {
    font-weight: 600;
    margin-bottom: 4px;
    flex: 1;
}

.order-item-quantity {
    color: #ff6b00;
    font-size: 14px;
}

.order-item-price {
    font-weight: 600;
    font-size: 18px;
    margin-left: 16px;
}

.comment-section {
    margin: 16px;
}

.comment-input {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.comment-hint {
    color: #888;
    font-size: 12px;
    margin-top: 8px;
}

/* Comment section for products view */
.products-comment-section {
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.products-comment-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

.btn-pay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #4caf50;
    color: white;
    border: none;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    z-index: 100;
}

.order-summary-card {
    background: white;
    margin: 16px;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 16px;
}

.order-summary-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.order-summary-image-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.order-summary-image-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    width: 100%;
    height: 100%;
}

.order-summary-info {
    flex: 1;
}

.order-summary-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.order-summary-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 4px;
}

.order-summary-shop {
    color: #888;
    font-size: 12px;
    margin-bottom: 12px;
}

.order-summary-items {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.order-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.order-summary-item-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-summary-item-image {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.order-summary-item-emoji {
    font-size: 20px;
    flex-shrink: 0;
}

.order-summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #000;
    font-weight: 600;
    font-size: 16px;
}

.payment-info-section {
    background: white;
    margin: 16px;
    border-radius: 12px;
    overflow: hidden;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row span:first-child {
    flex: 1;
    text-align: left;
}

.info-row span:nth-child(2) {
    color: #666;
    margin-right: 8px;
}

.chevron {
    color: #999;
    font-size: 20px;
}

.btn-pay-large {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0088cc;
    color: white;
    border: none;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    z-index: 100;
}

.form-section {
    background: white;
    margin: 16px;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.section-header {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    font-family: inherit;
}

.form-input:last-child {
    margin-bottom: 0;
}

.save-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.save-info-hint {
    color: #888;
    font-size: 12px;
    line-height: 1.4;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #4caf50;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.payment-method-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    z-index: 200;
    max-height: 80vh;
}

.modal-header {
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-bottom: 16px;
}

.payment-options {
    margin-bottom: 16px;
}

.payment-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.payment-option:last-child {
    border-bottom: none;
}

.btn-cancel-modal {
    width: 100%;
    background: #0088cc;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

#paymentMethodView {
    background: rgba(0,0,0,0.5);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    display: none;
    align-items: flex-end;
}

#paymentMethodView.active {
    display: flex;
}

/* Menu buttons */
.menu-buttons {
    display: flex;
    gap: 12px;
    padding: 0 16px 16px;
}

.menu-btn {
    flex: 1;
    background: white;
    border: 1px solid #e0e0e0;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.menu-btn.admin-btn {
    background: #f0f8ff;
    border-color: #0088cc;
    color: #0088cc;
}

/* Orders history */
.orders-list {
    padding: 16px;
}

.order-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-number {
    font-weight: 600;
    font-size: 16px;
}

.order-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-new {
    background: #e3f2fd;
    color: #1976d2;
}

.status-processing {
    background: #fff3e0;
    color: #f57c00;
}

.status-completed {
    background: #e8f5e9;
    color: #388e3c;
}

.status-cancelled {
    background: #ffebee;
    color: #d32f2f;
}

/* Order actions */
.order-actions {
    padding: 20px;
    text-align: center;
}

.btn-edit-order {
    width: 100%;
    background: #0088cc;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
}

.btn-edit-order:hover {
    background: #0077b3;
}

.btn-edit-order:active {
    background: #006699;
}

/* Edit Order View */
.edit-order-actions {
    padding: 20px;
    text-align: center;
}

.btn-save-order {
    width: 100%;
    background: #4caf50;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Admin order actions */
.admin-order-actions {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-change-status {
    width: 100%;
    background: #ff9800;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-change-status:hover {
    background: #f57c00;
}

.btn-change-status:active {
    background: #e65100;
}

/* Status change dialog */
.status-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.status-dialog {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.status-dialog h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
}

.status-dialog select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
}

.dialog-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-primary {
    background: #0088cc;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    background: #0077b3;
}
    transition: background-color 0.2s;
}

.btn-save-order:hover {
    background: #45a049;
}

.btn-save-order:active {
    background: #3d8b40;
}

.btn-save-order:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.status-cancelled {
    background: #ffebee;
    color: #d32f2f;
}

.order-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #666;
    font-size: 14px;
}

.order-date {
    color: #999;
    font-size: 12px;
}

.order-total {
    font-weight: 600;
    color: #000;
    font-size: 16px;
}

.order-user {
    color: #666;
    font-size: 14px;
    margin-bottom: 4px;
}

.order-comment-preview {
    margin-top: 8px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 12px;
    color: #666;
    font-style: italic;
    border-left: 3px solid #0088cc;
}

/* Order details */
.order-details-content {
    padding: 16px;
}

.order-details-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
}

.order-details-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.order-details-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.order-details-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.admin-notes-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.btn-save-notes {
    background: #4caf50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-save-notes:hover {
    background: #45a049;
}

.btn-edit-notes {
    background: #0088cc;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-edit-notes:hover {
    background: #0077b3;
}

.user-notes-preview {
    margin-top: 8px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.user-notes-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.user-notes-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}

.user-notes-textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    box-sizing: border-box;
}

.user-notes-textarea:focus {
    outline: none;
    border-color: #0088cc;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.order-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.order-detail-item-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-detail-item-image {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.order-detail-item-emoji {
    font-size: 20px;
    flex-shrink: 0;
}

/* Admin panel */
.admin-menu {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-menu-btn {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
}

.admin-content {
    padding: 16px;
}

.admin-filters {
    padding: 16px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.admin-filters select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.admin-search {
    padding: 16px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.admin-search input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.users-list {
    padding: 16px;
}

.user-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-card-main {
    cursor: pointer;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.user-info {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #666;
    flex-wrap: wrap;
}

.wholesale-badge {
    background: #e8f5e9;
    color: #388e3c;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.user-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.btn-toggle-wholesale {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #0088cc;
    background: white;
    color: #0088cc;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toggle-wholesale:hover {
    background: #f0f8ff;
}

.btn-toggle-wholesale.active {
    background: #0088cc;
    color: white;
}

.admin-order-cart {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    max-height: 400px;
    overflow-y: auto;
}

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

.cart-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-name {
    font-weight: 600;
    font-size: 16px;
}

.cart-item-size,
.cart-item-quantity,
.cart-item-price {
    font-size: 14px;
    color: #666;
}

.cart-total {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid #0088cc;
    font-size: 18px;
    text-align: right;
}

/* Admin Products Management Styles */
.admin-products-header {
    display: flex;
    gap: 12px;
    padding: 16px;
    align-items: center;
}

.admin-products-header .admin-search {
    flex: 1;
}

.btn-add-product {
    padding: 12px 20px;
    background: #0088cc;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-add-product:hover {
    background: #0077b3;
}

.products-list {
    padding: 16px;
}

.product-admin-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 16px;
    align-items: center;
}

.product-admin-image-container {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.product-admin-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-admin-emoji {
    font-size: 40px;
}

.product-admin-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-admin-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.product-admin-artikul,
.product-admin-category {
    font-size: 14px;
    color: #666;
}

.product-admin-prices {
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: #0088cc;
    font-weight: 600;
}

.product-admin-status {
    margin-top: 4px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.available {
    background: #e8f5e9;
    color: #388e3c;
}

.status-badge.unavailable {
    background: #ffebee;
    color: #c62828;
}

.product-admin-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-edit-product,
.btn-toggle-availability {
    padding: 8px 16px;
    border: 2px solid #0088cc;
    background: white;
    color: #0088cc;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-edit-product:hover,
.btn-toggle-availability:hover {
    background: #f0f8ff;
}

.btn-toggle-availability.active {
    background: #0088cc;
    color: white;
}

.admin-product-form {
    padding: 16px;
}

.form-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.form-textarea:focus {
    outline: none;
    border-color: #0088cc;
}

.image-upload-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-upload-image {
    padding: 12px 20px;
    background: #f5f5f5;
    color: #333;
    border: 2px dashed #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload-image:hover {
    background: #e8e8e8;
    border-color: #0088cc;
}

.image-preview {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 12px;
}

.image-preview-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

.size-inventory-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.size-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.size-input-group label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.btn-save-product {
    flex: 1;
    padding: 16px;
    background: #0088cc;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-save-product:hover {
    background: #0077b3;
}

.btn-cancel {
    flex: 1;
    padding: 16px;
    background: white;
    color: #0088cc;
    border: 2px solid #0088cc;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-cancel:hover {
    background: #f0f8ff;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.admin-create-order {
    padding: 16px;
}

.admin-order-products {
    margin: 12px 0;
    min-height: 100px;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 12px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* Order Confirmation View */
.order-confirmation-content {
    padding: 40px 20px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.confirmation-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.order-confirmation-content h2 {
    font-size: 24px;
    margin: 20px 0;
    color: #333;
}

.confirmation-message {
    font-size: 16px;
    color: #666;
    margin: 20px 0;
    line-height: 1.5;
}

.confirmation-total {
    font-size: 20px;
    font-weight: 600;
    color: #0088cc;
    margin: 20px 0;
}

.confirmation-status {
    font-size: 16px;
    color: #666;
    margin: 20px 0;
}

.confirmation-status strong {
    color: #ff9800;
}

.btn-primary {
    width: 100%;
    background: #0088cc;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background: #0077b3;
}

.btn-primary:active {
    background: #006699;
}

.btn-secondary {
    width: 100%;
    background: white;
    color: #0088cc;
    border: 2px solid #0088cc;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background: #f0f8ff;
}

.btn-secondary:active {
    background: #e0f0ff;
}

