/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    background: #fff;
    color: #1a1a1a;
    min-height: 100vh;
    line-height: 1.55;
}

/* === Header === */
.header {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #eee;
}
.header h1 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.header h1.title-pending { visibility: hidden; }

/* === Tab Bar (Bottom Navigation) === */
.tab-bar {
    display: flex;
    background: #fff;
    border-top: 1px solid #eee;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab {
    flex: 1;
    padding: 10px 4px 8px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.7rem;
    color: #bbb;
    cursor: pointer;
    border-top: 2px solid transparent;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: 52px;
}
.tab .tab-icon {
    width: 22px;
    height: 22px;
}
.tab.active {
    color: #1a1a1a;
    border-top-color: #1a1a1a;
    font-weight: 600;
}

/* === Pages === */
.page { padding: 16px 16px 80px; }
.page.hidden { display: none !important; }
.hidden:not(.page) { display: none !important; }

/* Prevent mobile scroll snap-back */
html, body { overscroll-behavior-y: none; -webkit-overflow-scrolling: touch; }
#app { min-height: 100vh; }

/* === Cards === */
.card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 12px;
}
.card h3 {
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.card-list { display: flex; flex-direction: column; gap: 8px; }

/* === Product Card === */
.product-card {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.15s;
}
.product-card:hover { border-color: #ccc; }
.product-row-top {
    display: flex;
    align-items: center;
    gap: 10px;
}
.product-card .product-img {
    width: 40px; height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: #f5f5f5;
    flex-shrink: 0;
    cursor: zoom-in;
}
.product-card .product-info { flex: 1; min-width: 0; }
.product-card .product-name {
    font-weight: 600; font-size: 0.9rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-card .product-price {
    font-weight: 600; font-size: 0.9rem; color: #1a1a1a;
    flex-shrink: 0; white-space: nowrap;
}
.product-row-mid { padding-left: 30px; }
/* Category groups */
.category-group { margin-bottom: 12px; }
.category-header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; background: #f5f5f5; border-radius: 8px;
    cursor: pointer; user-select: none; min-height: 44px;
}
.category-header:active { background: #eee; }
.category-arrow { font-size: 0.7rem; color: #888; transition: transform 0.2s; }
.category-title { font-weight: 600; font-size: 0.9rem; flex: 1; }
.category-count { font-size: 0.75rem; color: #999; background: #e8e8e8; padding: 1px 8px; border-radius: 10px; }
.category-group.collapsed .category-body { display: none; }
.category-group.collapsed .category-arrow { transform: rotate(-90deg); }
.category-check-all { width: 18px; height: 18px; accent-color: #1a1a1a; cursor: pointer; flex-shrink: 0; }
.product-select { width: 20px; height: 20px; flex-shrink: 0; accent-color: #1a1a1a; cursor: pointer; }
.product-card .product-note { color: #999; font-size: 0.75rem; }
.product-card .product-actions { display: flex; gap: 8px; padding-left: 30px; }
.product-card .product-actions button {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #eee;
    cursor: pointer;
    font-size: 0.75rem;
    font-family: inherit;
    background: #fff;
    transition: all 0.15s;
    min-height: 32px;
}
.product-card .product-actions button:active { background: #f5f5f5; }
.btn-edit { color: #666; }
.btn-delete { color: #c55; }
.btn-delete-order { background: #c55 !important; color: #fff !important; border-color: #c55 !important; }

/* === Order Card === */
.order-card {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.15s;
}
.order-card:active { background: #fafafa; transform: scale(0.99); }
.order-card .order-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.order-card .order-name { font-weight: 600; font-size: 0.9rem; }
.order-card .order-form-tag { display: inline-block; background: #f0f4f8; color: #4a6378; font-size: 0.72rem; padding: 2px 8px; border-radius: 10px; margin-bottom: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-card .order-items { color: #999; font-size: 0.8rem; }
.order-card .order-amount { font-weight: 600; font-size: 0.88rem; margin-top: 6px; }

/* === Status === */
.status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.status-pending { background: #f5f0e0; color: #8a7530; }
.status-confirmed { background: #e8f1fb; color: #2c5d9c; }
.status-paid { background: #e5f0e5; color: #3a7a3a; }
.status-shipped { background: #e5edf5; color: #3a5a8a; }
.status-completed { background: #eee; color: #666; }
.status-cancelled { background: #f5e5e5; color: #a54; }

/* === Forms === */
label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: #999;
    margin-bottom: 6px;
    margin-top: 16px;
    letter-spacing: 0.01em;
}
label:first-child { margin-top: 0; }
.required { color: #c55; }
input[type="text"], input[type="tel"], input[type="url"],
input[type="number"], input[type="email"], textarea, select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: #1a1a1a;
    transition: border-color 0.15s;
    -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #1a1a1a;
}
input::placeholder, textarea::placeholder { color: #ccc; }
textarea { min-height: 64px; resize: vertical; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    background: #fff;
    color: #1a1a1a;
    transition: all 0.15s;
    gap: 4px;
    min-height: 44px;
}
.btn:active { background: #f5f5f5; transform: scale(0.97); }
.btn-primary { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.btn-primary:active { background: #333; }
.btn-icon {
    background: none;
    border: none;
    font-size: 0.82rem;
    cursor: pointer;
    padding: 8px 10px;
    color: #999;
    font-family: inherit;
    font-weight: 500;
    transition: color 0.15s;
    min-height: 44px;
}
.btn-icon:active { color: #1a1a1a; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-submit {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    margin-top: 20px;
    border-radius: 10px;
    font-weight: 600;
    position: sticky;
    bottom: 16px;
    z-index: 50;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}

/* === Modal === */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal.hidden { display: none; }
.modal-content {
    background: #fff;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 14px 14px 0 0;
    padding: 24px 20px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.btn-close {
    background: #f5f5f5;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #999;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.btn-close:active { background: #eee; }
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}
.form-actions select { max-width: 100px; }
@media (max-width: 380px) {
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; }
}

/* === Panel === */
.panel {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
    animation: fadeIn 0.15s;
}
.panel.hidden { display: none; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-body {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.hint { font-size: 0.75rem; color: #bbb; margin-top: 6px; }

/* === Section Header === */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-header h2 { font-size: 1rem; font-weight: 700; }

/* === Cost === */
.cost-section h4 {
    font-size: 0.82rem;
    font-weight: 600;
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid #eee;
    color: #666;
}
.rate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rate-item label { font-size: 0.75rem; margin-top: 0; }
.rate-item input { font-size: 0.88rem; padding: 10px 12px; }
.cost-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    gap: 10px;
}
.cost-row:last-child { border: none; }
.cost-row-info { flex: 1; min-width: 0; }
.cost-row-name { font-weight: 600; font-size: 0.85rem; }
.cost-row-detail { color: #bbb; font-size: 0.75rem; margin-top: 2px; }
.cost-row-amount { font-weight: 600; font-size: 0.88rem; white-space: nowrap; }
.cost-row-actions { display: flex; gap: 8px; }
.cost-row-actions button {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #eee;
    background: #fff;
    cursor: pointer;
    font-size: 0.75rem;
    font-family: inherit;
    transition: all 0.15s;
    min-height: 36px;
}
.cost-row-actions button:active { background: #f5f5f5; }
.cost-total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #1a1a1a;
    font-weight: 600;
    text-align: right;
    font-size: 0.88rem;
    line-height: 1.8;
    color: #666;
}
/* === Cost Product Block === */
.cost-product-block {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}
.cost-product-header {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}
.cost-product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}
.cost-product-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cost-label {
    font-size: 0.72rem;
    color: #999;
}
.cost-value {
    font-size: 0.85rem;
    font-weight: 600;
}
.cost-highlight { color: #e74c3c; }
.cost-product-profit {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.8rem;
    color: #666;
}
.profit-positive { color: #3a7a3a; font-weight: 600; }
.profit-negative { color: #e74c3c; font-weight: 600; }

.cost-summary-card { background: #fafafa; }
.cost-summary-card h3 { color: #999; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 0.88rem; border-bottom: 1px solid #eee; }
.summary-row:last-child { border: none; }
.summary-row.sub { font-size: 0.8rem; color: #888; }
.summary-row.sub span:last-child { font-size: 0.75rem; }
.summary-row.total {
    font-size: 1rem;
    font-weight: 700;
    border-top: 1px solid #1a1a1a;
    border-bottom: none;
    margin-top: 4px;
    padding-top: 10px;
}
.summary-row.profit { font-weight: 600; }

/* === Image Upload === */
.image-upload-area {
    border: 1px dashed #ddd;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s;
}
.image-upload-area:active { border-color: #999; }
.image-upload-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 24px;
    color: #ccc;
    font-size: 0.85rem;
}
.image-upload-btn span:first-child { font-size: 1.5rem; font-weight: 300; }
.image-preview { position: relative; width: 100%; }
.image-preview img {
    width: 100%;
    max-height: 160px;
    object-fit: contain;
    display: block;
    background: #fafafa;
}
.btn-remove-img {
    position: absolute;
    top: 8px; right: 8px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Filters === */
.filters { display: flex; gap: 8px; margin-bottom: 14px; }
.filters input { flex: 1; }
.filters select { width: 110px; }
@media (max-width: 380px) {
    .filters { flex-direction: column; }
    .filters select { width: 100%; }
}

/* === Checkbox === */
.checkbox-group { display: flex; flex-direction: column; gap: 6px; }
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: border-color 0.15s;
    min-height: 48px;
}
.checkbox-item:has(input:checked) { border-color: #1a1a1a; }
.checkbox-item input[type="checkbox"] { width: 20px; height: 20px; accent-color: #1a1a1a; flex-shrink: 0; }
.checkbox-item label { margin: 0; flex: 1; font-weight: 400; font-size: 0.88rem; color: #1a1a1a; }
.checkbox-item.no-stock { opacity: 0.5; }
.checkbox-item.no-stock label { color: #999; }

/* === Form List === */
.form-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 10px;
}
.form-list-item:last-child { border-bottom: none; }
.form-list-info { flex: 1; min-width: 0; }
.form-list-title { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-list-meta { font-size: 0.78rem; color: #999; margin-top: 2px; }
.form-list-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-sm { padding: 8px 12px; font-size: 0.78rem; border: 1px solid #ddd; border-radius: 6px; background: #fff; cursor: pointer; min-height: 36px; }
.btn-sm:active { background: #f5f5f5; }
.btn-delete-sm { color: #c55; border-color: #e8c0c0; }
.form-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
}
.form-list-check-all { font-size: 0.85rem; color: #666; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check { width: 20px; height: 20px; accent-color: #1a1a1a; flex-shrink: 0; cursor: pointer; }

/* === Link Box === */
.link-box { display: flex; gap: 8px; }
.link-box input { flex: 1; }
.link-box .btn { flex-shrink: 0; }

/* === Form Page === */
.form-page .header { justify-content: center; border-bottom: 1px solid #eee; }
.order-form { padding: 16px 16px 24px; }
#customerAddress { min-height: 9.5em; }

/* === Purchase Page === */
.purchase-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-toggle { padding: 6px 12px; border: 1px solid #ddd; background: #fff; color: #888; border-radius: 999px; font-size: 0.82rem; cursor: pointer; white-space: nowrap; transition: all 0.15s; }
.filter-toggle:hover { border-color: #bbb; color: #555; }
.filter-toggle.active { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }
.purchase-order { margin-bottom: 10px; border: 1px solid #eee; border-radius: 8px; overflow: hidden; }
.purchase-order-header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: #f5f5f5; cursor: pointer; user-select: none; min-height: 44px; }
.purchase-order-header:active { background: #eee; }
.purchase-order-arrow { font-size: 0.7rem; color: #888; transition: transform 0.2s; }
.purchase-order-info { flex: 1; min-width: 0; }
.purchase-order-title { font-weight: 600; font-size: 0.9rem; color: #1a1a1a; }
.purchase-order-meta { font-size: 0.75rem; color: #888; margin-top: 2px; }
.purchase-order-summary { font-size: 0.78rem; color: #666; background: #fff; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.purchase-order-summary.done { color: #27ae60; background: #eafaf1; }
.purchase-order.collapsed .purchase-order-body { display: none; }
.purchase-order.collapsed .purchase-order-arrow { transform: rotate(-90deg); }
.purchase-order-body { padding: 8px 12px; background: #fff; }
.purchase-item { display: grid; grid-template-columns: 44px minmax(180px, 1fr) auto 64px auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid #f4f4f4; font-size: 0.85rem; }
.purchase-item:last-child { border-bottom: none; }
.purchase-item-img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #f0f0f0; cursor: zoom-in; }
.purchase-item-img.placeholder { background: repeating-linear-gradient(45deg, #f4f4f4, #f4f4f4 4px, #fafafa 4px, #fafafa 8px); }
.purchase-item-name { font-weight: 500; color: #1a1a1a; min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.purchase-item-ordered { font-size: 0.78rem; color: #666; white-space: nowrap; }
.purchase-item-input { width: 64px; padding: 4px 6px; border: 1px solid #ddd; border-radius: 6px; font-size: 0.85rem; text-align: center; }
.purchase-item-input:focus { outline: none; border-color: #1a1a1a; }
.purchase-item-shortage { font-size: 0.78rem; font-weight: 600; min-width: 56px; text-align: right; white-space: nowrap; }
.purchase-item-shortage.short { color: #e74c3c; }
.purchase-item-shortage.done { color: #27ae60; }
@media (max-width: 480px) {
    .purchase-item { grid-template-columns: 44px 1fr 64px auto; grid-template-areas: "img name name name" "img ordered input shortage"; gap: 4px 8px; }
    .purchase-item-img { grid-area: img; }
    .purchase-item-name { grid-area: name; }
    .purchase-item-ordered { grid-area: ordered; }
    .purchase-item-input { grid-area: input; }
    .purchase-item-shortage { grid-area: shortage; }
}
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.label-actions { display: flex; gap: 6px; }
.btn-inline { background: #1a1a1a; color: #fff; border: none; border-radius: 6px; padding: 4px 10px; font-size: 0.78rem; cursor: pointer; font-weight: 500; }
.btn-inline:hover { background: #333; }
.btn-inline:active { background: #000; }

/* === Product Selection === */
.product-select-item {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.product-select-item .qty-control { display: flex; align-items: center; gap: 6px; }
.product-select-item.sold-out { background: #fafafa; opacity: 0.65; }
.variant-row { display: grid; grid-template-columns: 1fr 100px 36px; gap: 6px; margin-bottom: 6px; align-items: center; }
.variant-row input { width: 100%; }
.btn-variant-del { background: #eee; color: #c0392b; padding: 6px 0; min-width: 36px; }
.btn-variant-del:hover { background: #fce4e0; }
.product-variant-options { display: grid; gap: 6px; margin-top: 8px; }
.variant-option { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid #f3f3f3; }
.variant-option-name { font-size: 0.88rem; color: #333; }
.variant-option-name.sold-out { color: #c0392b; }
.product-select-item.sold-out .product-select-img { filter: grayscale(0.6); }
.qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-btn {
    width: 44px; height: 44px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: all 0.15s;
    font-weight: 300;
    -webkit-tap-highlight-color: transparent;
}
.qty-btn:active { border-color: #1a1a1a; color: #1a1a1a; background: #f5f5f5; }
.qty-value { width: 32px; text-align: center; font-weight: 700; font-size: 1rem; }
.product-select-img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0; cursor: zoom-in; }
.product-select-info { flex: 1; }
.product-select-name { font-weight: 600; font-size: 0.9rem; }
.product-select-price { color: #666; font-size: 0.78rem; margin-top: 2px; }

/* === Total Amount === */
.bank-info-display {
    background: #f0f7ff;
    border: 1px solid #d0e3f7;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    font-size: 0.88rem;
    line-height: 1.8;
    color: #2c3e50;
}
.total-amount {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    font-weight: 600;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.7;
}

/* === Success === */
.success-card { text-align: center; padding: 48px 24px; }
.success-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: #e5f0e5;
    color: #3a7a3a;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.success-card h2 { color: #3a7a3a; margin-bottom: 6px; font-size: 1.1rem; }
.success-card p { color: #999; font-size: 0.88rem; }
.order-summary {
    text-align: left;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px;
    margin-top: 24px;
}
.order-summary p { padding: 6px 0; border-bottom: 1px solid #f5f5f5; font-size: 0.85rem; }
.order-summary p:last-child { border: none; }
.order-summary strong { color: #999; font-weight: 500; }

/* === Notice === */
.notice {
    background: #fafafa;
    border-left: 2px solid #1a1a1a;
    padding: 10px 14px;
    margin: 16px 16px 0;
    font-size: 0.85rem;
    color: #666;
}

/* === Stats === */
.stats { border: 1px solid #eee; border-radius: 10px; padding: 14px; }
.stats p { padding: 4px 0; font-size: 0.85rem; color: #666; }

/* === Order Detail === */
.order-stats { font-size: 0.85rem; color: #888; padding: 0 4px 8px; }
.order-detail-row { display: flex; padding: 10px 0; border-bottom: 1px solid #f5f5f5; }
.order-detail-row:last-child { border: none; }
.order-detail-label { width: 90px; flex-shrink: 0; color: #bbb; font-size: 0.82rem; font-weight: 500; }
.order-detail-value { flex: 1; font-size: 0.88rem; word-break: break-all; }

/* === Order Edit === */
.order-edit-form h3 { margin-bottom: 12px; font-size: 1rem; }
.order-edit-form label { display: block; margin-top: 12px; font-size: 0.82rem; color: #999; margin-bottom: 4px; }
.order-edit-form input, .order-edit-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #e0e0e0; border-radius: 8px; font-size: 0.9rem; }
.order-edit-form textarea { min-height: 50px; resize: vertical; }
.edit-item-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.edit-item-row input { flex: 1; min-width: 0; }
.btn-remove-item { background: none; border: none; color: #c55; font-size: 1.2rem; cursor: pointer; padding: 8px 10px; flex-shrink: 0; min-width: 36px; min-height: 36px; display: flex; align-items: center; justify-content: center; }

/* === Order Item Row (detail modal) === */
.order-item-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.order-item-img { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }

/* === Screenshot === */
.screenshot-area { background: #fff; padding: 20px; border-radius: 8px; }
.screenshot-area h3 { text-align: center; color: #1a1a1a; margin-bottom: 12px; font-size: 0.88rem; font-weight: 700; }

/* === Toast === */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #fff;
    padding: 10px 22px;
    border-radius: 100px;
    font-size: 0.82rem;
    z-index: 999;
    animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === Image Lightbox === */
.image-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; z-index: 1000; cursor: zoom-out; padding: 24px; animation: lightboxIn 0.18s ease-out; }
.image-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,0.4); }
@keyframes lightboxIn { from { opacity: 0; } to { opacity: 1; } }

/* === Loading === */
.loading { text-align: center; padding: 48px; color: #ccc; font-size: 0.85rem; }
.spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 1.5px solid #eee;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-bottom: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Empty === */
.empty-state { text-align: center; padding: 48px 24px; color: #ccc; }
.empty-state .empty-icon { font-size: 1.5rem; margin-bottom: 8px; font-weight: 300; }
.empty-state p { font-size: 0.85rem; }

/* === Loading Screen === */
.loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.loading-card {
    text-align: center;
    color: #666;
}
.loading-card p {
    margin-top: 16px;
    font-size: 1rem;
}
.loading-spinner {
    width: 40px; height: 40px;
    margin: 0 auto;
    border: 3px solid #e0e0e0;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* === Login Screen === */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}
.login-card {
    text-align: center;
    max-width: 320px;
    width: 100%;
}
.login-icon {
    width: 56px; height: 56px;
    margin: 0 auto 16px;
    display: block;
}
.header-logo {
    width: 28px; height: 28px;
    vertical-align: middle;
    margin-right: 6px;
}
.login-card h1 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}
.login-card p {
    color: #888;
    font-size: 0.88rem;
    margin-bottom: 24px;
    line-height: 1.5;
}
.btn-google {
    width: 100%;
    padding: 14px;
    font-size: 0.95rem;
    border-radius: 10px;
}

/* === User Info === */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-info span {
    font-size: 0.78rem;
    color: #888;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-logout {
    border: 1px solid #ddd;
    background: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
    color: #888;
    cursor: pointer;
    font-family: inherit;
    min-height: 36px;
}
.btn-logout:active { border-color: #999; color: #333; }

/* === Responsive === */
@media (min-width: 540px) {
    body { max-width: 480px; margin: 0 auto; border-left: 1px solid #eee; border-right: 1px solid #eee; }
    .tab-bar { max-width: 480px; left: 50%; transform: translateX(-50%); }
}
