/* ============================================
   owner.css — 사장님 메뉴 관리 패널 스타일
   ============================================ */

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

:root {
    --primary: #FF6B35;
    --primary-dim: rgba(255, 107, 53, .1);
    --bg: #F5F5F7;
    --surface: #FFFFFF;
    --border: #E5E7EB;
    --text: #111111;
    --text-sub: #6B7280;
    --danger: #EF4444;
    --success: #10B981;
    --radius: 16px;
}

body {
    font-family: 'Noto Sans KR', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── PIN 화면 ── */
.pin-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, #1A1A2E 0%, #2D2D4E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.pin-card {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 28px;
    padding: 40px 32px 32px;
    width: 320px;
    text-align: center;
    backdrop-filter: blur(20px);
}

.pin-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.pin-title {
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 6px;
}

.pin-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, .5);
    margin-bottom: 24px;
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}

.pin-dots span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .3);
    background: transparent;
    transition: all .2s;
}

.pin-dots span.filled {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(255, 107, 53, .5);
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.key-btn {
    aspect-ratio: 1;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, transform .1s;
}

.key-btn:active {
    background: var(--primary);
    transform: scale(.9);
}

.key-btn.key-empty {
    background: transparent;
    cursor: default;
}

.key-btn.key-del {
    font-size: 20px;
}

.pin-error {
    font-size: 13px;
    color: #FF6B6B;
    min-height: 18px;
    animation: shake .3s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}

/* ── 메인 앱 ── */
.owner-app {
    min-height: 100vh;
}

/* 헤더 */
.owner-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0, 0, 0, .06);
}

.owner-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.owner-header-icon {
    font-size: 32px;
}

.owner-header-left h1 {
    font-size: 18px;
    font-weight: 900;
}

.owner-header-sub {
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 2px;
}

.owner-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-preview {
    padding: 8px 16px;
    border-radius: 10px;
    background: var(--primary-dim);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: 1.5px solid rgba(255, 107, 53, .2);
    transition: background .15s;
}

.btn-preview:hover {
    background: rgba(255, 107, 53, .2);
}

.btn-logout {
    padding: 8px 16px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-sub);
    font-size: 13px;
    font-weight: 700;
    border: 1.5px solid var(--border);
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
}

.btn-logout:hover {
    background: #E5E7EB;
}

/* 탭 네비게이션 */
.owner-tabs {
    display: flex;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}

.owner-tab {
    padding: 14px 20px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    color: var(--text-sub);
    cursor: pointer;
    transition: color .2s, border-color .2s;
    white-space: nowrap;
}

.owner-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* 탭 콘텐츠 */
.tab-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 20px 100px;
}

/* 카테고리 필터 */
.category-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.cat-filter-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    border-radius: 100px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-sub);
    cursor: pointer;
    transition: all .15s;
}

.cat-filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cat-filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.cat-filter-btn.add-cat {
    border-style: dashed;
}

.cat-filter-btn.add-cat:hover {
    background: var(--bg);
}

/* 카테고리 섹션 */
.menu-section {
    margin-bottom: 28px;
}

.menu-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.menu-section-title {
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-section-count {
    font-size: 12px;
    color: var(--text-sub);
    background: var(--bg);
    padding: 3px 10px;
    border-radius: 100px;
}

/* 메뉴 아이템 카드 */
.menu-item-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    transition: box-shadow .2s, border-color .2s;
}

.menu-item-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
    border-color: #D1D5DB;
}

.menu-item-card.unavailable {
    opacity: .5;
}

.item-emoji {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, #FFF0E8, #FFE4D2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    flex-shrink: 0;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 3px;
}

.item-desc {
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-price {
    font-size: 15px;
    font-weight: 900;
    color: var(--primary);
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.toggle-avail {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

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

.toggle-track {
    position: absolute;
    inset: 0;
    background: #D1D5DB;
    border-radius: 100px;
    transition: background .2s;
}

.toggle-avail input:checked+.toggle-track {
    background: var(--success);
}

.toggle-track::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

.toggle-avail input:checked+.toggle-track::after {
    transform: translateX(20px);
}

.btn-edit,
.btn-del {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.btn-edit:hover {
    background: var(--primary-dim);
    border-color: var(--primary);
}

.btn-del:hover {
    background: #FEE2E2;
    border-color: var(--danger);
}

/* FAB */
.fab-add {
    position: fixed;
    bottom: 28px;
    right: 28px;
    padding: 14px 24px;
    border-radius: 100px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(255, 107, 53, .45);
    transition: transform .2s, box-shadow .2s;
    z-index: 200;
}

.fab-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255, 107, 53, .55);
}

/* ── 설정 탭 ── */
.settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.settings-title {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-sub);
}

.form-group input,
.form-select {
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color .2s;
}

.form-group input:focus,
.form-select:focus {
    border-color: var(--primary);
    background: var(--surface);
}

.required {
    color: var(--primary);
}

.btn-save-settings {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 107, 53, .35);
    transition: transform .15s;
}

.btn-save-settings:hover {
    transform: translateY(-1px);
}

.danger-zone .settings-title {
    color: var(--danger);
}

.danger-desc {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 16px;
    line-height: 1.6;
}

.btn-danger {
    padding: 12px 24px;
    border-radius: 10px;
    border: 1.5px solid var(--danger);
    background: #FEF2F2;
    color: var(--danger);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
}

.btn-danger:hover {
    background: #FEE2E2;
}

/* ── 모달 ── */
.modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-bg.open {
    display: flex;
}

.item-modal {
    background: var(--surface);
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
    animation: modalIn .3s cubic-bezier(.22, .61, .36, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.92) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.item-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.item-modal-header h2 {
    font-size: 18px;
    font-weight: 900;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
}

.item-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* 이모지 선택 */
.emoji-pick-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.emoji-preview {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--bg);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    flex-shrink: 0;
    cursor: pointer;
}

.emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.emoji-opt {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.emoji-opt:hover {
    background: var(--primary-dim);
    border-color: var(--primary);
}

.emoji-opt.selected {
    background: var(--primary);
    border-color: var(--primary);
}

.item-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.btn-cancel {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-sub);
}

.btn-submit {
    flex: 2;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255, 107, 53, .35);
}

/* 알림 토스트 */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: #1A1A2E;
    color: #fff;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* 반응형 */
@media (max-width: 600px) {
    .tab-content {
        padding: 16px 14px 100px;
    }

    .owner-header {
        padding: 14px 16px;
    }

    .btn-preview span {
        display: none;
    }
}