.qty-risk-suffix {
    font-size: 0.72rem;
    font-weight: 400;
    color: #555;
    vertical-align: middle;
}

.yesterday-qty-value {
    font-size: 0.76rem;
    font-weight: 400;
    color: #7d5e45;
}
.yesterday-qty-unit {
    font-size: 0.81rem;
    font-weight: 400;
    color: #b1967e;
}
.product-info-quickchange {
    font-weight: 400;
}
/* 상품관리 카드 레이아웃 개선 */
.product-card-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.product-card-name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 40%;
}

.product-card-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: 0 0 auto;
    min-width: 70px;
    margin-right: 4px;
}

.product-card-actions {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}
/* 상품관리 상품정보 2줄 표시 */
.product-info-block {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    margin-right: 4px;
}

.product-info-line1 {
    font-size: 0.88rem;
    color: #7d5e45;
    font-weight: 700;
    line-height: 1.1;
}

.product-info-line2 {
    font-size: 0.88rem;
    color: #b1967e;
    font-weight: 400;
    line-height: 1.1;
}
/* 상품관리 안전재고/빠른증감/단위 텍스트 스타일 */
.product-meta-text {
    display: inline-block;
    font-size: 0.82rem;
    color: #7a5a1a;
    font-weight: 500;
    margin-right: 10px;
    letter-spacing: -0.01em;
    vertical-align: middle;
}
/* 상품관리 안전재고/단위 배지 */
/* 상품관리 안전재고/빠른증감/단위 배지 통일 */
.badge-riskqty, .badge-unit, .product-action-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 26px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0 12px;
    text-align: center;
    margin-right: 4px;
    box-sizing: border-box;
}
.badge-riskqty {
    background: #fff8e1;
    border: 1.5px solid #ffd54f;
    color: #ff9800;
}
.badge-unit {
    background: #f3f6fa;
    border: 1px solid #c7d3e6;
    color: #4b5a6a;
}
.product-action-meta {
    background: #f2f8f3;
    border: 1px solid #cbe2d1;
    color: #2f8f5b;
}
/* 상품관리 상품목록 안전재고 단위 여백 */
.product-action-unit {
    margin-left: 4px;
}
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

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

:root {
    --primary: #2f8f5b;
    --primary-strong: #25744a;
    --primary-soft: #d8efe2;
    --secondary: #5d7a69;
    --success: #2f8f5b;
    --danger: #d66d63;
    --warning: #d49852;
    --bg-page: #f4faf6;
    --bg-soft: #f8fcf9;
    --surface: #ffffff;
    --surface-2: #f6fbf8;
    --border-soft: #dbe9e1;
    --text-dark: #1f3a2b;
    --text-muted: #6f8b7b;
    --shadow-soft: 0 24px 52px rgba(39, 95, 64, 0.09);
    --shadow-strong: 0 36px 72px rgba(39, 95, 64, 0.14);
    --store-header-image: url('https://images.unsplash.com/photo-1509440159596-0249088772ff?auto=format&fit=crop&w=1400&q=80');
}

body {
    font-family: "Plus Jakarta Sans", "Noto Sans KR", sans-serif;
    color: var(--text-dark);
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    background:
        radial-gradient(circle at 92% -6%, rgba(47, 143, 91, 0.14) 0%, rgba(47, 143, 91, 0) 46%),
        radial-gradient(circle at 4% 104%, rgba(182, 224, 198, 0.2) 0%, rgba(182, 224, 198, 0) 50%),
        var(--bg-page);
}

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: flex;
}

#loginScreen {
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        linear-gradient(120deg, rgba(28, 22, 17, 0.58) 0%, rgba(28, 22, 17, 0.36) 100%),
    url('https://images.unsplash.com/photo-1488459716781-31db52582fe9?auto=format&fit=crop&w=1600&q=80') center/cover no-repeat;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 40px 30px;
    border-radius: 34px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 253, 251, 0.92);
    box-shadow: var(--shadow-strong);
    animation: rise-in 0.45s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header h1 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: clamp(2rem, 4.7vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #2d2218;
    margin-bottom: 8px;
}

.brand-mark {
    display: inline-block;
    width: 24px;
    height: 20px;
    border: 1.8px solid currentColor;
    border-radius: 7px;
    position: relative;
}

.brand-mark::before {
    content: "";
    position: absolute;
    left: 5px;
    right: 5px;
    top: 6px;
    border-top: 1.8px solid currentColor;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.96rem;
    font-weight: 500;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 15px 18px;
    border: 1px solid transparent;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.2s ease;
    color: #ffffff;
}

.login-btn .btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.22);
}

.login-btn.google { background: #4285f4; }
.login-btn.naver { background: #11b15f; }
.login-btn.kakao { background: #fee500; color: #2a241f; }
.login-btn.demo {
    background: linear-gradient(135deg, #d88445 0%, #f0a26c 100%);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(109, 83, 61, 0.2);
}

#appScreen {
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.65);
    background:
        linear-gradient(90deg, rgba(18, 61, 38, 0.76) 0%, rgba(18, 61, 38, 0.58) 100%),
        var(--store-header-image) center/cover no-repeat;
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-btn,
.user-btn {
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
    min-width: 44px;
    min-height: 44px;
    border-radius: 16px;
    padding: 8px 10px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(32, 20, 12, 0.24);
}

.user-btn {
    font-size: 0.82rem;
    font-weight: 700;
}

.app-title {
    font-size: clamp(1.42rem, 2.8vw, 1.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.42);
    cursor: pointer;
}

.header-spacer {
    min-width: 44px;
    min-height: 44px;
}

.header-status-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sync-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.sync-status-badge.syncing {
    background: rgba(43, 113, 77, 0.45);
    border-color: rgba(196, 244, 216, 0.8);
}

.sync-status-badge.queued {
    background: rgba(132, 94, 36, 0.45);
    border-color: rgba(255, 223, 163, 0.8);
}

.sync-status-badge.retrying {
    background: rgba(155, 58, 58, 0.52);
    border-color: rgba(255, 191, 191, 0.86);
}

.top-notice {
    display: none;
    padding: 10px 14px;
    border-bottom: 1px solid #f0ddbf;
    background: #fff5e6;
    color: #8c5f2a;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.35;
}

.top-notice.active {
    display: block;
}

.sync-error-toast {
    position: fixed;
    left: 50%;
    top: 78px;
    transform: translate(-50%, -8px);
    z-index: 1200;
    max-width: min(92vw, 560px);
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid #efb6b6;
    background: rgba(102, 29, 29, 0.95);
    color: #fff5f5;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
    box-shadow: 0 14px 28px rgba(56, 17, 17, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sync-error-toast.active {
    opacity: 1;
    transform: translate(-50%, 0);
}

.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 18px 0 104px;
    background: #ffffff;
}

.view {
    display: none;
    padding: 14px;
}

.view.active {
    display: block;
    animation: fade-in 0.24s ease;
}

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

.view-header h2 {
    font-size: clamp(1.44rem, 2.5vw, 1.7rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #2e241b;
}

.btn-primary,
.btn-secondary {
    border: none;
    border-radius: 18px;
    padding: 10px 16px;
    font-size: 0.87rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #49a977 100%);
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(44, 128, 82, 0.28);
}

.btn-secondary {
    background: #e8f4ed;
    color: #2f6a4a;
}

.btn-invite-cancel {
    border: none;
    border-radius: 18px;
    padding: 10px 16px;
    font-size: 0.87rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f5e8d8;
    color: #a0622e;
}

.btn-invite {
    border: none;
    border-radius: 18px;
    padding: 10px 16px;
    font-size: 0.87rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #c9834a 0%, #a0622e 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(160, 98, 46, 0.28);
}

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.inventory-list,
.category-list,
.product-list,
.group-list,
.order-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 36px 16px;
    background: var(--surface);
    border: 1px dashed #e6d9c8;
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
}

.inventory-group,
.order-table-wrap,
.product-card,
.group-card,
.modal-content,
.login-container {
    box-shadow: var(--shadow-soft);
}

.inventory-group {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    overflow: hidden;
}

.inventory-group-header {
    width: 100%;
    border: none;
    background: linear-gradient(90deg, #edf8f1 0%, #e3f3ea 100%);
    color: #2f6a4a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
}

.inventory-group-arrow {
    width: 10px;
    height: 10px;
    border-right: 1.8px solid #5b8f73;
    border-bottom: 1.8px solid #5b8f73;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
}

.inventory-group-arrow.open {
    transform: rotate(45deg);
}

.inventory-group-body {
    display: none;
    padding: 0;
    background: var(--surface);
    border-top: 1px solid var(--border-soft);
}

.inventory-group.open .inventory-group-body {
    display: block;
}

.inventory-item,
.product-card,
.group-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 18px 40px rgba(91, 69, 50, 0.08);
}

.group-card-ungrouped {
    background: linear-gradient(120deg, #f4f7fb 0%, #eef3f9 100%);
    border: 1px dashed #c6d4e6;
    box-shadow: 0 12px 28px rgba(75, 101, 133, 0.12);
}

.group-card-ungrouped .card-title {
    color: #3f5d82;
}

.group-card-ungrouped .group-count-badge {
    background: #e5edf8;
    border-color: #c7d8ee;
    color: #3f5d82;
}

.group-card-ungrouped .group-drag-handle {
    color: #7594b8;
}

.inventory-group-body .inventory-item {
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
}

.inventory-group-body .inventory-item + .inventory-item {
    border-top: 1px dashed #c9dbcf;
    margin-top: 0;
    padding-top: 18px;
}

.inventory-item.inventory-item-danger {
    border-color: #efc8be;
    background: linear-gradient(120deg, #fff7f5 0%, #fff2ef 100%);
    box-shadow: 0 10px 24px rgba(189, 90, 78, 0.12);
}

.inventory-group-body .inventory-item.inventory-item-danger {
    border: 0;
    background: linear-gradient(100deg, #fff8f6 0%, #fff3f1 72%, #fff0ed 100%);
    box-shadow: 0 6px 16px rgba(189, 90, 78, 0.1);
}

.inventory-group-body .inventory-item + .inventory-item.inventory-item-danger {
    border-top: 1px dashed #c9dbcf;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.item-mainline,
.card-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.item-name,
.card-title {
    font-size: 1.04rem;
    font-weight: 800;
    color: #362a1f;
}

.item-info {
    font-size: 0.81rem;
    color: #9b7f64;
}

.item-meta {
    font-size: 0.76rem;
    color: #b1967e;
}

.item-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
}

.item-badges-inline {
    flex-direction: row;
    align-items: center;
}

.item-badge {
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #f5f5f5;
    color: #444;
}

.item-last-updated {
    background: #e9f1ff;
    color: #486490;
}

.badge-active { background: #e8f7ef; color: #2f7a4c; }
.badge-inactive { background: #ffe6e4; color: #b4473f; }
.badge-warning { background: #ffe7e2; color: #b14d42; }
.hidden { display: none; }

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

.item-controls-yesterday {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

.item-controls-input {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.item-controls-unit {
    min-width: 50px;
    display: flex;
    justify-content: flex-start;
}

.item-meta-yesterday {
    white-space: nowrap;
    font-size: 0.76rem;
    font-weight: 400;
}

.item-unit {
    white-space: nowrap;
}

.qty-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    font-size: 1.02rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: #7d5e45;
    background: #fff7f0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.qty-btn.minus-fast { background: #fff0eb; color: #bd6b63; }
.qty-btn.minus { background: #fff7ea; color: #ac7c3d; }
.qty-btn.plus { background: #edf8f1; color: #4a8460; }
.qty-btn.plus-fast { background: #ffefdf; color: #bf7340; }

.qty-input {
    width: 90px;
    padding: 10px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: #fffdfb;
    color: #5d4532;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
}

.product-card {
    padding: 0;
    overflow: hidden;
}

.product-photo {
    width: 100%;
    height: 152px;
    object-fit: cover;
    display: block;
    filter: saturate(1.12) contrast(1.05);
}

.product-photo.photo-fallback {
    background: linear-gradient(135deg, #f8dcc1 0%, #f1c39c 100%);
    filter: saturate(1) contrast(1);
}

.card-header {
    padding: 14px 16px;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.group-card .card-header {
    padding: 0;
}

.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: #fff7f0;
    color: #8a6e57;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.icon-btn::before,
.icon-btn::after {
    content: "";
    position: absolute;
}

.icon-btn.icon-edit::before {
    width: 14px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    transform: rotate(-35deg);
}

.icon-btn.icon-delete::before {
    width: 12px;
    height: 11px;
    border: 1.7px solid currentColor;
    border-top: none;
    border-radius: 0 0 4px 4px;
    top: 14px;
}

.icon-btn.icon-delete::after {
    width: 14px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    top: 11px;
}

.category-count,
.group-count-badge,
.product-action-meta {
    font-size: 0.78rem;
    font-weight: 700;
    color: #4d6488;
    background: #edf3ff;
    border: 1px solid #d7e2f4;
    border-radius: 999px;
    padding: 4px 10px;
    white-space: nowrap;
}

.product-action-meta-risk {
    color: #8a6513;
    background: #fff3c9;
    border-color: #f1dd99;
}

.product-location-inline {
    font-size: 0.78rem;
    color: #9b7d63;
    font-weight: 600;
}

.group-products-wrap {
    margin-top: 12px;
    margin-left: 28px;
}

.group-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 30px;
}

.group-chip {
    padding: 5px 11px;
    border-radius: 999px;
    background: #fdf0e5;
    color: #8e6746;
    border: 1px solid #efdac6;
    font-size: 0.84rem;
}

.group-chip-button {
    cursor: grab;
    font: inherit;
    line-height: 1.2;
}

.group-chip-button:active {
    cursor: grabbing;
}

.group-chip-button.dragging-chip {
    opacity: 0.65;
}

.group-chip-touch-ghost {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.9;
    box-shadow: 0 10px 24px rgba(54, 42, 31, 0.18);
}

.group-chip-button:hover {
    background: #f9e5d2;
    border-color: #e7c9ad;
}

.group-product-option-name {
    font-weight: 500;
}

.group-product-option-location {
    margin-left: 6px;
    font-size: 0.82rem;
    color: #8b95a1;
}

.group-product-option-locked {
    margin-left: 6px;
    font-size: 0.78rem;
    color: #b07a74;
}

.group-product-option {
    display: flex;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
}

.group-product-option:hover {
    background: #f9fafb;
}

.group-product-option.is-locked {
    cursor: not-allowed;
    opacity: 0.55;
}

.group-product-option.is-locked:hover {
    background: transparent;
}

.group-products-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    width: 100%;
    pointer-events: none;
}

.product-category-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.product-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 4px;
}

.product-category-header h3 {
    font-size: 1.08rem;
    font-weight: 800;
    color: #5a412d;
}

.product-category-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 24px;
}

.group-sortable-item,
.category-sortable-item,
.product-sortable-item {
    touch-action: none;
}

.group-sortable-item.dragging,
.category-sortable-item.dragging,
.product-sortable-item.dragging,
.sortable-item.dragging {
    opacity: 0.58;
    transform: scale(0.99);
}

.group-drag-handle,
.category-drag-handle,
.product-drag-handle,
.drag-handle {
    width: 20px;
    height: 18px;
    cursor: grab;
    user-select: none;
    position: relative;
    color: #b29173;
    flex: 0 0 auto;
    background:
        radial-gradient(circle, currentColor 1.3px, transparent 1.3px) 2px 2px / 8px 8px repeat;
    opacity: 0.9;
}

.group-drag-handle:active,
.category-drag-handle:active,
.product-drag-handle:active,
.drag-handle:active {
    cursor: grabbing;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(39, 28, 18, 0.2);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

/* 메시지 전용 모달 (입력 모달 위에 표시) */
.message-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: rgba(39, 28, 18, 0.3);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.message-modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 30px;
    border: 1px solid var(--border-soft);
    background: var(--surface);
    animation: rise-in 0.2s ease;
}

/* 메시지 모달용 작은 크기 */
.modal-content-compact {
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 30px;
    border: 1px solid var(--border-soft);
    background: var(--surface);
    animation: rise-in 0.2s ease;
}

.modal-header,
.modal-footer {
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header {
    border-bottom: 1px solid var(--border-soft);
}

.modal-footer {
    border-top: 1px solid var(--border-soft);
    justify-content: flex-end;
    gap: 10px;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #3c2c1f;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: #fff6ee;
    color: #9f7f64;
    cursor: pointer;
}

.modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    min-height: 0;
    flex: 1;
}

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

.form-row {
    display: flex;
    gap: 10px;
}

.form-row > .form-group-inline {
    flex: 1;
}

.form-row-3 .form-group-inline {
    flex: 1;
}

.form-row-2 .form-group-inline {
    flex: 1;
}

.form-row-category-order .form-group-inline:first-child {
    flex: 1;
}

.form-group-order {
    flex: 0 0 11ch;
    width: 11ch;
    min-width: 0;
    max-width: 11ch;
}

.form-group-order-compact {
    flex-basis: 7ch;
    width: 7ch;
}

.form-input-order {
    width: 100%;
    min-width: 0;
}

.form-select-order {
    width: 100%;
    min-width: 0;
}

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: #6d4f34;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: #fffdfb;
    color: var(--text-dark);
    font-size: 0.92rem;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: rgba(216, 132, 69, 0.62);
    box-shadow: 0 0 0 3px rgba(216, 132, 69, 0.18);
}

.sortable-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sortable-item {
    border-radius: 18px;
    border: 1px dashed #e2d3bf;
    background: #fffaf4;
    padding: 12px;
    cursor: move;
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-category-section {
    margin-bottom: 22px;
}

.order-category-title {
    font-size: 1.08rem;
    font-weight: 800;
    color: #64482f;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8dbc8;
}

.order-table-wrap {
    border: 1px solid #e7d9c7;
    border-radius: 10px;
    overflow: hidden;
    background: #fffdfb;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.order-col-name { width: 46%; }
.order-col-qty { width: 34%; }
.order-col-updated { width: 20%; }

.order-table thead tr {
    background: #ecf7f0;
    border-bottom: 1px solid #d9eadd;
}

.order-table th,
.order-table td {
    padding: 12px;
    text-align: left;
}

.order-table th {
    font-size: 0.82rem;
    font-weight: 800;
    color: #896c53;
}

.order-table tbody tr {
    border-bottom: 1px solid #e4efe7;
}

.order-table tbody tr:last-child {
    border-bottom: none;
}

.order-row-danger {
    background: #fff6f3;
}

.order-product-name {
    font-weight: 700;
    color: #4b3524;
    font-size: 0.98rem;
}

.order-location {
    color: #9a7d66;
    font-size: 0.9rem;
}

.order-qty {
    font-weight: 800;
    font-size: 1.08rem;
}

.order-qty-line {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
    max-width: 100%;
}

.order-qty-value {
    font-size: 1.16rem;
    line-height: 1;
    letter-spacing: 0.2px;
    vertical-align: middle;
}

.order-qty-unit {
    font-size: 0.78rem;
    font-weight: 400;
    color: #8f735d;
    margin-left: 4px;
}

.order-qty-risk { color: #bd6057; }
.order-qty-ok { color: #4d8b63; }
.order-qty-empty { color: #cb7a64; }

.order-updated {
    color: #8f735d;
    font-size: 0.8rem;
    white-space: normal;
    line-height: 1.25;
}

.order-updated-cell {
    vertical-align: middle;
    text-align: center !important;
}

.order-updated-risk {
    color: #bd6057;
    font-weight: 700;
}

.order-warning-badge {
    display: inline-block;
    margin-right: 2px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff1df;
    border: 1px solid #f1d4b3;
    color: #a96c2d;
    font-size: 0.72rem;
    font-weight: 800;
    vertical-align: middle;
}

.order-risk-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f0ebe4;
    border: 1px solid #d9cec3;
    color: #7d6550;
    font-size: 0.70rem;
    font-weight: 600;
    vertical-align: middle;
}

.col-right {
    text-align: right !important;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: transparent;
    border-top: none;
    backdrop-filter: blur(12px);
}

.bottom-nav-item {
    border: 1px solid var(--border-soft);
    background: var(--surface);
    color: #84674f;
    border-radius: 10px;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(91, 69, 50, 0.08);
}

.bottom-nav-item.active {
    color: #2f7f55;
    border-color: #b9dcc8;
    background: #edf8f1;
}

.bottom-nav-item.locked {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.my-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.my-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 16px;
    box-shadow: var(--shadow-soft);
}

.my-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: #5a412d;
    margin-bottom: 10px;
}

.my-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0e4d5;
}

.my-item-stack {
    flex-direction: column;
    align-items: stretch;
}

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

.my-store-actions .btn-secondary {
    flex: 1 1 120px;
}

.my-help {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.my-invite-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.my-invite-input-group .form-input {
    flex: 1;
}

.my-item:last-of-type {
    border-bottom: none;
}

.my-label {
    color: var(--text-muted);
    font-weight: 700;
}

.my-value {
    color: var(--text-dark);
    font-weight: 700;
    text-align: right;
}

.my-value-with-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.my-value-with-action .btn-secondary {
    padding: 6px 12px;
    font-size: 0.78rem;
    border-radius: 12px;
}

.my-logout-btn {
    width: 100%;
    margin-top: 14px;
}

.my-withdraw-section {
    margin-top: 6px;
}

.my-withdraw-btn {
    width: 100%;
    background: #d32f2f;
    border: 1px solid #b71c1c;
    color: #ffffff;
    font-weight: 700;
    border-radius: 10px;
    padding: 12px 14px;
}

.my-withdraw-btn:hover {
    background: #b71c1c;
}

.my-user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.my-user-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.my-user-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 10px;
    background: #fffdfb;
}

.my-user-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.my-user-name {
    font-weight: 700;
    color: var(--text-dark);
}

.my-user-email {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.my-user-role-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.my-user-controls {
    justify-content: flex-end;
}

.my-role-select {
    min-width: 120px;
    padding: 8px 10px;
}

.my-user-remove-btn {
    padding: 8px 10px;
    min-width: 64px;
}

.my-invite-list {
    margin-top: 12px;
    border-top: 1px solid #f0e4d5;
    padding-top: 10px;
}

.my-invite-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.my-subtitle {
    font-size: 0.9rem;
    font-weight: 700;
    color: #6d4f34;
    margin-bottom: 0;
}

.my-invite-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    border: 1px dashed #e2d3bf;
    border-radius: 10px;
    padding: 8px 10px;
    background: #fffaf4;
    margin-bottom: 8px;
}

.my-invite-main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1;
    min-width: 0;
}

.my-invite-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.my-invite-code {
    font-weight: 800;
    color: #4b3524;
    letter-spacing: 0.4px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 95px;
}

.my-invite-sub {
    display: block;
    margin-top: 0;
    padding-top: 2px;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: right;
}

.my-invite-action {
    display: flex;
    align-items: center;
    align-self: stretch;
    border-left: 1px solid #e2d3bf;
    padding-left: 10px;
    margin-left: 2px;
    flex-shrink: 0;
}

.my-invite-btn {
    white-space: nowrap;
    flex-shrink: 0;
    align-self: center;
}

.my-invite-role,
.my-invite-status {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.my-invite-user-main {
    font-size: 0.84rem;
    color: #7b6856;
    font-weight: 700;
    margin-left: auto;
    text-align: right;
}

.my-invite-user-email {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.role-badge {
    font-size: 0.74rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 4px 9px;
    border: 1px solid transparent;
}

.role-general {
    color: #6b7280;
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.role-auditor {
    color: #2f7a4c;
    background: #e8f7ef;
    border-color: #cfead9;
}

.role-admin {
    color: #2d5f90;
    background: #e9f1ff;
    border-color: #d0dff7;
}

.role-owner {
    color: #8a6513;
    background: #fff3c9;
    border-color: #f1dd99;
}

.role-staff {
    color: #2f7a4c;
    background: #e8f7ef;
    border-color: #cfead9;
}

.invite-status-badge {
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 8px;
    border: 1px solid transparent;
    display: inline-block;
}

.invite-status-pending {
    color: #8a6513;
    background: #fff8e1;
    border-color: #f1dd99;
}

.invite-status-accepted {
    color: #2f7a4c;
    background: #e8f7ef;
    border-color: #cfead9;
}

.my-invite-time {
    font-size: 0.74rem;
    color: #9ca3af;
}

.view.active .inventory-group,
.view.active .product-card,
.view.active .group-card,
.view.active .order-table-wrap {
    animation: rise-in 0.34s ease both;
}

.line-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    color: currentColor;
    position: relative;
    flex: 0 0 auto;
}

.line-icon::before,
.line-icon::after {
    content: "";
    position: absolute;
}

.icon-user::before {
    width: 7px;
    height: 7px;
    border: 1.7px solid currentColor;
    border-radius: 50%;
    top: 1px;
    left: 5px;
}

.icon-user::after {
    width: 12px;
    height: 7px;
    border: 1.7px solid currentColor;
    border-top: none;
    border-radius: 0 0 8px 8px;
    left: 3px;
    bottom: 2px;
}

.icon-menu {
    background:
        linear-gradient(currentColor, currentColor) 2px 4px / 14px 1.7px no-repeat,
        linear-gradient(currentColor, currentColor) 2px 8px / 14px 1.7px no-repeat,
        linear-gradient(currentColor, currentColor) 2px 12px / 14px 1.7px no-repeat;
}

.icon-export::before {
    width: 11px;
    height: 11px;
    border: 1.7px solid currentColor;
    border-top: none;
    border-radius: 0 0 4px 4px;
    left: 3px;
    bottom: 2px;
}

.icon-export::after {
    width: 8px;
    height: 8px;
    border-right: 1.7px solid currentColor;
    border-top: 1.7px solid currentColor;
    transform: rotate(135deg);
    left: 5px;
    top: 0;
}

.icon-chart {
    background:
        linear-gradient(currentColor, currentColor) 2px 11px / 3px 5px no-repeat,
        linear-gradient(currentColor, currentColor) 7px 8px / 3px 8px no-repeat,
        linear-gradient(currentColor, currentColor) 12px 5px / 3px 11px no-repeat;
}

.icon-box::before {
    inset: 2px;
    border: 1.7px solid currentColor;
    border-radius: 4px;
}

.icon-box::after {
    left: 4px;
    right: 4px;
    top: 8px;
    border-top: 1.7px solid currentColor;
}

.icon-clipboard::before {
    inset: 3px 3px 2px;
    border: 1.7px solid currentColor;
    border-radius: 4px;
}

.icon-clipboard::after {
    width: 8px;
    height: 3px;
    border: 1.7px solid currentColor;
    border-radius: 4px;
    top: 0;
    left: 5px;
}

.icon-close::before,
.icon-close::after {
    width: 14px;
    height: 1.7px;
    border-radius: 999px;
    background: currentColor;
    left: 2px;
    top: 8px;
}

.icon-close::before { transform: rotate(45deg); }
.icon-close::after { transform: rotate(-45deg); }

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.992);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (min-width: 900px) {
    .view {
        width: 100%;
        max-width: 1020px;
        margin: 0 auto;
        padding: 16px 18px;
    }

    .app-header {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 30px 22px;
        border-radius: 28px;
    }

    .app-title {
        font-size: 1.25rem;
    }

    .view {
        padding: 12px;
    }

    .qty-btn {
        width: 40px;
        height: 40px;
    }

    .qty-input {
        width: 76px;
    }

    .item-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .product-photo {
        height: 132px;
    }
}

/* 토글 스위치 */
.toggle-switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch-text {
    font-size: 0.88rem;
    color: #7d5e45;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background: #d9cfc7;
    border-radius: 999px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-switch.on {
    background: #f0b17d;
}

.toggle-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: left 0.2s;
}

.toggle-switch.on .toggle-switch-thumb {
    left: 23px;
}
