﻿/* ======== Reset & Base ======== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif; font-size: 13px; color: #173321; background: #f3f6f2; }
a { text-decoration: none; color: inherit; }
input, button, select, textarea { font-family: inherit; font-size: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid rgba(0,107,52,.45); outline-offset: 2px; }

/* ======== Login Page ======== */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: radial-gradient(circle at 18% 22%, rgba(255,255,255,.14), transparent 26%), linear-gradient(135deg, #005f2f 0%, #008444 100%); }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-card { background: #fff; border-radius: 10px; padding: 34px; box-shadow: 0 20px 60px rgba(0,80,40,0.22); }
.login-header { text-align: center; margin-bottom: 32px; }
.login-header h1 { font-size: 24px; font-weight: 700; color: #1a1a2e; margin-bottom: 8px; }
.login-header p { color: #888; font-size: 14px; }
.login-form .form-group { margin-bottom: 20px; }
.login-form label { display: block; font-size: 13px; font-weight: 500; color: #444; margin-bottom: 6px; }
.login-form input { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; transition: border-color 0.2s; outline: none; }
.login-form input:focus { border-color: #006b34; box-shadow: 0 0 0 3px rgba(0,107,52,0.14); }
.form-error { background: #fff2f0; border: 1px solid #ffccc7; color: #cf1322; padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; text-align: center; }

/* ======== Buttons ======== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 14px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s; }
.btn-primary { background: #006b34; color: #fff; }
.btn-primary:hover { background: #00552a; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-full { width: 100%; padding: 12px; font-size: 16px; }
.btn-outline { background: transparent; border: 1px solid #d9d9d9; color: #444; }
.btn-outline:hover { border-color: #006b34; color: #006b34; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-danger:hover { background: #e04345; }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-text { background: transparent; color: #888; border: none; padding: 6px 12px; }
.btn-text:hover { color: #ff4d4f; }

/* ======== Layout ======== */
.dashboard-body { overflow: hidden; }
.app-layout { display: flex; height: 100vh; }

/* ======== Sidebar ======== */
.sidebar { width: 150px; background: #006b34; color: #fff; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { display: block; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.brand-avatar { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.sidebar-header h2 { font-size: 15px; font-weight: 700; line-height: 1.2; }
.user-info { display: flex; align-items: center; gap: 8px; }
.user-role-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-hq { background: #52c41a; color: #fff; }
.badge-employee { background: #1890ff; color: #fff; }
.user-name { font-size: 13px; color: rgba(255,255,255,0.8); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section { margin-bottom: 8px; }
.nav-section-title { padding: 6px 14px 4px; font-size: 11px; text-transform: uppercase; color: rgba(255,255,255,0.55); letter-spacing: 1px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 7px; padding: 7px 12px; color: rgba(255,255,255,0.82); transition: all 0.15s; cursor: pointer; }
.nav-item.nav-subitem { padding-left: 32px; font-size: 12px; color: rgba(255,255,255,0.72); }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.16); color: #fff; border-right: 3px solid #d9f99d; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-label { font-size: 14px; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); }

/* ======== Main Content ======== */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.content-header { padding: 9px 16px; min-height: 48px; background: #fff; border-bottom: 1px solid #dfe8df; }
.content-header h3 { font-size: 18px; font-weight: 600; color: #1a1a2e; }
.content-body { flex: 1; padding: 12px; overflow-y: auto; }
.dashboard-home .content-header { display: none; }
.dashboard-home .content-body { padding: 0; background: #f4f7f3; }
.dashboard-home .app-layout { display: block; height: 100vh; }
.dashboard-home .sidebar { position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; transform: translateX(-100%); transition: transform .24s ease; }
.dashboard-home .sidebar.open { transform: translateX(0); }
.dashboard-home .main-content { width: 100%; height: 100vh; }

/* ======== Module Content ======== */
.module-content { display: none; }
.module-content.active { display: block; }
.welcome-card { background: #fff; border-radius: 8px; padding: 18px; text-align: center; box-shadow: 0 1px 5px rgba(0,0,0,0.05); }
.dashboard-grid { min-height: 100%; padding: 18px; display: grid; place-items: stretch; }
.dashboard-hero { position: relative; min-height: calc(100vh - 44px); border-radius: 18px; background: radial-gradient(circle at 18% 20%, rgba(255,255,255,.14), transparent 28%), linear-gradient(135deg,#005f2f 0%,#007a3b 54%,#009452 100%); color: #fff; display: grid; grid-template-columns: 1fr; align-items: center; gap: 32px; padding: 48px; overflow: hidden; box-shadow: 0 18px 46px rgba(0,92,44,.24); cursor: pointer; }
.dashboard-hero::after { content:""; position:absolute; inset:auto -80px -120px auto; width:340px; height:340px; border-radius:50%; border:70px solid rgba(255,255,255,.07); }
.hero-copy { position:relative; z-index:1; display: flex; align-items: center; justify-content: center; gap: 22px; }
.dashboard-logo { width: 118px; height: 118px; border-radius: 22px; object-fit: cover; border: 1px solid rgba(255,255,255,.42); box-shadow:0 14px 35px rgba(0,0,0,.16); }
.hero-copy h2 { font-size: 42px; line-height:1.12; margin-bottom: 12px; letter-spacing:0; }
.hero-copy p { font-size: 18px; font-weight: 600; opacity: .88; }
.dashboard-slogan { display:none; }
.dashboard-footnote { display:none; }
.dashboard-cards { display: grid; grid-template-columns: repeat(4,minmax(120px,1fr)); gap: 10px; }
.dash-card { text-align: left; border: 1px solid #dce8dc; background: #fff; border-radius: 8px; padding: 14px; cursor: pointer; color: #173321; }
.dash-card:hover { border-color: #006b34; box-shadow: 0 6px 18px rgba(0,107,52,.12); }
.dash-card strong { display:block; font-size: 15px; margin-bottom: 6px; }
.dash-card span { color:#607060; font-size:12px; }
.operator-info { display:flex; align-items:center; gap:8px; background:#f4faf4; border:1px solid #dcebdc; border-left:4px solid #006b34; border-radius:6px; padding:7px 10px; margin-bottom:10px; color:#24452d; }
.operator-info strong { color:#006b34; }
.safety-calendar { background:#fff; border:1px solid #dfe8df; border-radius:8px; padding:10px; margin-bottom:10px; }
.calendar-title { font-weight:600; margin-bottom:8px; color:#173321; }
.calendar-grid { display:grid; grid-template-columns:repeat(7, minmax(34px,1fr)); gap:4px; }
.cal-head { text-align:center; color:#6b7b6b; font-size:12px; padding:4px 0; }
.cal-empty { min-height:34px; }
.cal-day { border:1px solid #e3ebe3; background:#fff; border-radius:6px; min-height:38px; cursor:pointer; display:flex; align-items:center; justify-content:space-between; padding:0 8px; color:#173321; }
.cal-day.done { background:#f0f9f0; border-color:#a9d8b5; }
.cal-day.done b { color:#00833e; }
.cal-day.miss { background:#fff7f7; border-color:#f2caca; }
.cal-day.miss b { color:#cf1322; }
.cal-day.future { color:#9aa89a; background:#fafafa; }
.welcome-card h2 { font-size: 22px; margin-bottom: 12px; }
.welcome-card p { color: #666; }

/* ======== Module Toolbar ======== */
.module-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.search-input { max-width: 280px; flex: 1; }
.store-data-notice { margin: 0 0 8px; padding: 9px 12px; border: 1px solid #f0c36d; border-left: 4px solid #e59a13; border-radius: 6px; background: #fff8e8; color: #73510e; line-height: 1.55; }
.store-data-notice strong { color: #b26c00; }
.store-data-notice.is-error { border-color: #f1aeb0; border-left-color: #d9363e; background: #fff2f2; color: #9b2026; }
.store-value-missing { color: #a66a00; font-size: 12px; }
.store-quality-badge { display: inline-block; padding: 2px 7px; border-radius: 12px; font-size: 12px; white-space: nowrap; }
.store-quality-badge.is-complete { background: #edf9ef; color: #16733a; }
.store-quality-badge.is-incomplete { background: #fff3dd; color: #a76500; }
.store-row-incomplete td { background: #fffdf7; }
.store-preparation-intro { margin-bottom: 10px; padding: 12px 14px; border: 1px solid #cfe5d5; border-left: 4px solid #00833e; border-radius: 8px; background: #f4fbf6; color: #31543e; }
.store-preparation-intro strong { display: block; margin-bottom: 4px; color: #0b562d; }
.store-preparation-intro span { display: block; line-height: 1.55; }
.equipment-table { width: 100% !important; min-width: 920px !important; table-layout: fixed !important; }
.equipment-table th:nth-child(1) { width: 52px; }
.equipment-table th:nth-child(2) { width: 270px; }
.equipment-table th:nth-child(3) { width: 92px; }
.equipment-table th:nth-child(4) { width: 86px; }
.equipment-table th:nth-child(5) { width: 104px; }
.equipment-table th:nth-child(6) { width: 148px; }
.equipment-table th:nth-child(7) { width: 220px; }
.equipment-summary { display: flex; align-items: center; gap: 10px; min-width: 0; }
.equipment-thumb, .equipment-thumb-empty { flex: 0 0 58px; width: 58px; height: 58px; border-radius: 7px; border: 1px solid #dfe8e1; }
.equipment-thumb { display: block; object-fit: cover; cursor: zoom-in; background: #f7faf7; }
.equipment-thumb-empty { display: flex; align-items: center; justify-content: center; padding: 5px; background: #f7faf7; color: #8b998e; font-size: 11px; text-align: center; white-space: normal; }
.equipment-summary-copy { min-width: 0; }
.equipment-summary-copy strong { display: block; color: #173321; font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.equipment-summary-copy span { display: -webkit-box; margin-top: 4px; color: #657267; font-size: 12px; line-height: 1.4; white-space: normal; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.equipment-price-cell { font-weight: 600; color: #173321; }
.equipment-updated-cell { white-space: normal !important; line-height: 1.45; color: #5f6f63; }
.equipment-actions { white-space: normal !important; }
.equipment-actions .btn { margin: 2px 4px 2px 0 !important; }
.equipment-link { color: #006b34; text-decoration: underline; text-underline-offset: 2px; }
.equipment-link:hover { color: #004c25; }
.ingredient-table { width: 100% !important; min-width: 980px !important; table-layout: fixed !important; }
.ingredient-table th:nth-child(1) { width: 52px; }
.ingredient-table th:nth-child(2) { width: 82px; }
.ingredient-table th:nth-child(3) { width: 150px; }
.ingredient-table th:nth-child(4) { width: 142px; }
.ingredient-table th:nth-child(5) { width: 94px; }
.ingredient-table th:nth-child(6) { width: 88px; }
.ingredient-table th:nth-child(7) { width: 82px; }
.ingredient-table th:nth-child(8) { width: 104px; }
.ingredient-table th:nth-child(9) { width: 142px; }
.ingredient-name-cell strong { display: block; overflow: hidden; color: #173321; text-overflow: ellipsis; white-space: nowrap; }
.ingredient-supplier-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ingredient-price-cell { color: #173321; font-weight: 600; white-space: nowrap; }
.ingredient-actions { white-space: normal !important; }
.ingredient-actions .btn { margin: 2px 4px 2px 0 !important; }
.equipment-form-layout { display: grid; grid-template-columns: 170px minmax(0,1fr); gap: 18px; align-items: start; }
.equipment-image-box { width: 160px; height: 160px; }
.equipment-image-help { margin-top: 7px; color: #7b887e; font-size: 11px; line-height: 1.4; }
.equipment-form-fields { min-width: 0; }
.equipment-detail-layout { display: grid; grid-template-columns: minmax(220px,36%) minmax(0,1fr); gap: 22px; align-items: start; }
.equipment-detail-image, .equipment-detail-image-empty { width: 100%; aspect-ratio: 4/3; border-radius: 10px; border: 1px solid #dfe8e1; }
.equipment-detail-image { display: block; object-fit: cover; cursor: zoom-in; background: #f7faf7; }
.equipment-detail-image-empty { display: flex; align-items: center; justify-content: center; background: #f7faf7; color: #8b998e; }
.equipment-detail-title { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid #e5ece6; }
.equipment-detail-title h3 { margin: 0 0 8px; color: #173321; font-size: 20px; line-height: 1.35; }
.equipment-detail-title > strong { color: #006b34; font-size: 22px; white-space: nowrap; }
.equipment-detail-list { margin: 8px 0 0; }
.equipment-detail-list > div { display: grid; grid-template-columns: 86px minmax(0,1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf2ed; }
.equipment-detail-list dt { color: #718076; }
.equipment-detail-list dd { margin: 0; color: #273c2f; line-height: 1.6; overflow-wrap: anywhere; }
.equipment-detail-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ======== Form Elements ======== */
.form-input { width: 100%; min-height: 32px; padding: 5px 9px; border: 1px solid #cfdccf; border-radius: 6px; font-size: 13px; transition: border-color 0.2s; outline: none; background: #fff; }
.form-input:focus { border-color: #006b34; box-shadow: 0 0 0 3px rgba(0,107,52,0.1); }
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #444; margin-bottom: 6px; }

/* ======== Data Table ======== */
.data-table-wrapper { background: #fff; border: 1px solid #e1e9e1; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { position: sticky; top: 0; z-index: 1; background: #f5faf5; padding: 7px 9px; text-align: left; font-weight: 600; font-size: 12px; color: #31543e; border-bottom: 1px solid #e1e9e1; white-space: nowrap; }
.data-table td { padding: 6px 9px; border-bottom: 1px solid #edf2ed; font-size: 13px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: #fafafa; }
.empty-row { text-align: center; color: #bbb; padding: 40px 16px !important; }
.action-cell { white-space: nowrap; }
.action-cell .btn + .btn { margin-left: 6px; }

/* ======== Tags & Badges ======== */
.role-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.tag-hq { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-employee { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.tag-income { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-expense { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.status-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.tag-active { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-inactive { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }

/* ======== Modal ======== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: #fff; border-radius: 12px; width: 90%; max-width: 480px; max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #e8e8e8; }
.modal-header h4 { font-size: 16px; font-weight: 600; }
.modal-close { font-size: 16px; padding: 4px 8px; border-radius: 4px; }
.modal-close:hover { background: #f5f5f5; color: #333; }
.modal-body { padding: 12px; }
.modal-form .form-group:last-child { margin-bottom: 0; }
.modal-form .btn-full { margin-top: 16px; }

/* ======== Placeholder ======== */
.module-placeholder { text-align: center; padding: 60px; color: #bbb; font-size: 16px; background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }

/* ======== Scrollbar ======== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d9d9d9; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* ======== Modal Wide ======== */
.modal-wide { max-width: 800px; }
.modal-xwide { max-width: 1040px; }

/* ======== Form Sections ======== */
.form-section { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid #f0f0f0; }
.form-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.form-section-title { font-size: 15px; font-weight: 600; color: #1a1a2e; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.form-section-title .section-count { font-size: 12px; font-weight: 400; color: #999; background: #f5f5f5; padding: 1px 8px; border-radius: 10px; }
.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.form-row .form-group { flex: 1; margin-bottom: 0; }
.form-row .form-group.form-group-sm { flex: 0 0 auto; min-width: 80px; }

/* ======== Image Upload ======== */
.image-upload-area { display: flex; gap: 12px; flex-wrap: wrap; }
.image-upload-box { width: 120px; height: 120px; border: 2px dashed #d9d9d9; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden; background: #fafafa; }
.image-upload-box:hover { border-color: #006b34; background: #f1faf3; }
.image-upload-box .upload-icon { font-size: 28px; color: #bbb; margin-bottom: 4px; }
.image-upload-box .upload-text { font-size: 11px; color: #999; }
.image-upload-box img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; }
.image-upload-box .img-remove { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; background: rgba(0,0,0,0.5); color: #fff; border: none; border-radius: 50%; font-size: 12px; cursor: pointer; display: none; align-items: center; justify-content: center; line-height: 1; z-index: 2; }
.image-upload-box:hover .img-remove { display: flex; }
.image-upload-box.has-image { border-style: solid; border-color: #006b34; background: #fff; }
.image-detail-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.image-detail-item { width: 80px; height: 80px; border: 1px solid #e8e8e8; border-radius: 6px; overflow: hidden; position: relative; }
.image-detail-item img { width: 100%; height: 100%; object-fit: cover; }
.image-detail-item .img-remove { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; background: rgba(0,0,0,0.5); color: #fff; border: none; border-radius: 50%; font-size: 10px; cursor: pointer; display: none; align-items: center; justify-content: center; padding: 0; line-height: 1; }
.image-detail-item:hover .img-remove { display: flex; }

/* ======== Dynamic List ======== */
.dynamic-list { margin-bottom: 12px; }
.dynamic-list-item { background: #fafafa; border: 1px solid #e8e8e8; border-radius: 8px; padding: 12px; margin-bottom: 8px; position: relative; }
.dynamic-list-item:hover { border-color: #d9d9d9; }
.dynamic-list-item .item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dynamic-list-item .item-title { font-size: 13px; font-weight: 500; color: #333; }
.dynamic-list-item .item-body { display: none; }
.dynamic-list-item.expanded .item-body { display: block; }
.dynamic-list-item .btn-remove-item { background: none; border: none; color: #ff4d4f; cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 4px; }
.dynamic-list-item .btn-remove-item:hover { background: #fff2f0; }
.dynamic-list-item .btn-expand { background: none; border: none; color: #006b34; cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 4px; }
.dynamic-list-item .btn-expand:hover { background: #f1faf3; }
.btn-add-item { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; background: #f5f5f5; border: 1px dashed #d9d9d9; border-radius: 6px; color: #666; cursor: pointer; font-size: 13px; transition: all 0.2s; }
.btn-add-item:hover { border-color: #006b34; color: #006b34; background: #f1faf3; }

/* ======== Tableware Grid ======== */
.tableware-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.tableware-card { background: #fafafa; border: 1px solid #e8e8e8; border-radius: 8px; padding: 12px; }
.tableware-card .tw-name { font-size: 13px; font-weight: 500; color: #333; margin-bottom: 6px; }
.tableware-card .tw-inputs { display: flex; gap: 8px; }
.tableware-card .tw-inputs .form-group { margin-bottom: 0; flex: 1; }
.tableware-card .tw-inputs .form-group label { font-size: 11px; color: #888; margin-bottom: 2px; }
.tableware-card .tw-inputs input { padding: 4px 8px; font-size: 13px; }

/* ======== Ingredient Detail Popup ======== */
.detail-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 1100; }
.detail-popup { background: #fff; border-radius: 12px; width: 90%; max-width: 500px; max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.detail-popup-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #e8e8e8; }
.detail-popup-header h4 { font-size: 16px; font-weight: 600; }
.detail-popup-body { padding: 20px; }
.detail-field { margin-bottom: 14px; }
.detail-field:last-child { margin-bottom: 0; }
.detail-field label { display: block; font-size: 12px; font-weight: 500; color: #888; margin-bottom: 4px; }
.detail-field .detail-value { font-size: 14px; color: #333; line-height: 1.5; }

/* ======== Process Steps ======== */
.step-list { counter-reset: step-counter; }
.step-item { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; padding: 8px 12px; background: #fafafa; border: 1px solid #e8e8e8; border-radius: 6px; }
.step-item .step-number { width: 24px; height: 24px; background: #006b34; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.step-item .step-input { flex: 1; }
.step-item .step-input input { width: 100%; padding: 6px 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; }
.step-item .step-input input:focus { border-color: #006b34; outline: none; }
.step-item .btn-remove-step { background: none; border: none; color: #ff4d4f; cursor: pointer; font-size: 14px; padding: 2px 6px; }
.step-item .btn-remove-step:hover { background: #fff2f0; border-radius: 4px; }

.recipe-item { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.recipe-item input { flex: 1; padding: 6px 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; }
.recipe-item input:focus { border-color: #006b34; outline: none; }
.recipe-item .btn-remove-recipe { background: none; border: none; color: #ff4d4f; cursor: pointer; font-size: 14px; padding: 2px 6px; }
.recipe-item .btn-remove-recipe:hover { background: #fff2f0; border-radius: 4px; }

/* ======== Dish Detail View ======== */
.dish-preview-images { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.dish-preview-images img { width: 48px; height: 48px; border-radius: 4px; object-fit: cover; border: 1px solid #e8e8e8; }
.dish-detail-link { color: #006b34; cursor: pointer; text-decoration: underline; font-size: 12px; }
.dish-detail-link:hover { color: #00552a; }
.dish-ingredient-detail { background: #f9f9f9; border-radius: 6px; padding: 8px 12px; margin: 4px 0; font-size: 13px; line-height: 1.6; }
.dish-ingredient-detail strong { color: #555; }
.dish-process-detail { margin: 4px 0; font-size: 13px; }
.dish-process-detail ol { padding-left: 20px; margin: 4px 0; }
.dish-process-detail li { margin-bottom: 2px; }

/* ======== Handbook ======== */
.handbook-container { max-width: 800px; margin: 0 auto; }
.handbook-header { text-align: center; padding: 28px 20px; background: linear-gradient(135deg, rgba(0,107,52,.12), rgba(0,148,82,.10)); border-left: 4px solid #006b34; }
.handbook-header h2 { font-size: 20px; color: #1a1a2e; }
.handbook-container .report-card h4 { font-size: 15px; color: #006b34; border-left: 3px solid #006b34; padding-left: 10px; }
.handbook-container .report-card p { font-size: 14px; line-height: 1.8; color: #444; }
.handbook-footer { border-top: 2px solid #e8e8e8; }
/* ======== Store Info ======== */
.store-info-layout { max-width: 700px; margin: 0 auto; }
.store-info-layout .form-row { display: flex; gap: 12px; }
.store-info-layout .form-row .form-group { flex: 1; }
/* ======== Check-in ======== */
.checkin-container { max-width: 700px; margin: 0 auto; }
.checkin-photo-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.checkin-photo-item { width: 80px; height: 80px; border-radius: 6px; overflow: hidden; position: relative; border: 1px solid #e8e8e8; }
.checkin-photo-item img { width: 100%; height: 100%; object-fit: cover; }
.checkin-photo-item .remove-photo { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; background: rgba(0,0,0,0.5); color: #fff; border: none; border-radius: 50%; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.checkin-photo-item:hover .remove-photo { display: flex; }
.checkin-calendar { margin-top: 12px; }
.checkin-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.checkin-month .day-label { font-size: 11px; color: #999; padding: 4px 0; }
.checkin-month .day-cell { padding: 6px 0; border-radius: 4px; font-size: 12px; background: #fafafa; min-height: 32px; }
.checkin-month .day-cell.has-checkin { background: #e6f7ff; color: #1890ff; font-weight: 600; position: relative; }
.checkin-month .day-cell.has-checkin::after { content: '✓'; position: absolute; top: -2px; right: 2px; font-size: 9px; color: #52c41a; }
.checkin-month .day-cell.today { border: 2px solid #006b34; }
.checkin-month .day-cell.empty { background: transparent; }
/* ======== Handbook display fix ======== */
.handbook-container p, .handbook-container div { max-width: 100%; word-wrap: break-word; }

/* ======== Content Factory ======== */
.ops-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:10px; padding:10px 12px; border:1px solid #dfe8df; border-radius:8px; background:#f7fbf7; }
.ops-head strong { display:block; color:#063f24; font-size:16px; margin-bottom:3px; }
.ops-head span { color:#5d705f; font-size:12px; line-height:1.45; }
.ops-actions { display:flex; align-items:center; justify-content:flex-end; gap:6px; flex-wrap:wrap; }
.ops-date { width:140px; max-width:140px; }
.ops-search { width:190px; max-width:190px; }
.ops-stat-grid { display:grid; grid-template-columns:repeat(4,minmax(110px,1fr)); gap:8px; margin-bottom:10px; }
.ops-stat { border:1px solid #e1e9e1; border-radius:8px; padding:8px 10px; background:#fff; }
.ops-stat span { display:block; color:#66776a; font-size:12px; margin-bottom:3px; }
.ops-stat strong { color:#063f24; font-size:18px; }
.ops-service-frame { width:100%; height:calc(100vh - 132px); min-height:520px; border:1px solid #dfe9e2; border-radius:8px; background:#fff; }
.content-factory-shell { display: grid; grid-template-columns: minmax(280px, 360px) minmax(360px, 1fr) minmax(300px, .85fr); gap: 10px; align-items: start; }
.cf-panel { background: #fff; border: 1px solid #dfe8df; border-radius: 8px; padding: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.cf-input-panel { grid-row: span 2; position: sticky; top: 0; }
.cf-output-panel { min-height: 260px; }
.cf-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cf-panel-head h4 { font-size: 15px; color: #173321; }
.cf-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cf-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cf-output-empty { min-height: 150px; border: 1px dashed #cfdccf; border-radius: 8px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; color: #788878; background: #fbfdfb; }
.cf-output { display: grid; gap: 10px; }
.cf-result-block { border: 1px solid #e1e9e1; border-radius: 8px; overflow: hidden; background: #fcfdfc; }
.cf-result-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #f5faf5; border-bottom: 1px solid #e1e9e1; font-weight: 600; color: #31543e; }
.cf-result-block pre { white-space: pre-wrap; word-break: break-word; line-height: 1.7; padding: 10px; color: #213a29; font-family: inherit; font-size: 13px; }
.cf-calendar { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 8px; overflow-x: auto; }
.cf-day { min-height: 118px; border: 1px solid #e1e9e1; border-radius: 8px; padding: 9px; background: #fbfdfb; }
.cf-day strong { display: block; color: #006b34; margin-bottom: 6px; }
.cf-day span { display: block; font-weight: 600; margin-bottom: 5px; color: #173321; }
.cf-day p { color: #31543e; margin-bottom: 5px; line-height: 1.45; }
.cf-day small { color: #788878; line-height: 1.45; display: block; }
.cf-video-status { border: 1px solid #dfe8df; border-left: 4px solid #006b34; border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; color: #31543e; background: #f7fbf7; }
.cf-video-status.warn { border-left-color: #fa8c16; color: #7a4a00; background: #fff8e8; }
.cf-creator-grid { display: grid; grid-template-columns: 1.4fr 1.2fr .8fr .8fr; gap: 8px; align-items: end; }
.cf-media-list { display: grid; gap: 8px; margin-top: 4px; }
.cf-media-row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 10px; border: 1px solid #e1e9e1; border-radius: 8px; padding: 8px; background: #fbfdfb; }
.cf-media-thumb { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; background: #eef4ee; display: flex; align-items: center; justify-content: center; color: #607060; font-weight: 600; }
.cf-media-info strong { display: block; color: #173321; margin-bottom: 3px; word-break: break-all; }
.cf-media-info span { color: #788878; font-size: 12px; }
.cf-render-result { margin-top: 10px; }
.cf-render-result video { width: min(260px, 100%); max-height: 460px; background: #111; border-radius: 8px; display: block; margin-bottom: 8px; }
.cf-media-row .cf-actions, #cfDraftTable .action-cell, #cfPublishTable .action-cell, #cfAccountTable .action-cell { white-space: nowrap; }
#cfDraftTable td, #cfPublishTable td, #cfAccountTable td { vertical-align: middle; }
#cfDraftTable .action-cell { min-width: 190px; }
#cfPublishTable .action-cell { min-width: 260px; }

@media (max-width: 1200px) {
  .content-factory-shell { grid-template-columns: minmax(280px, 360px) 1fr; }
  .cf-input-panel { grid-row: span 2; }
}


/* ======== Mobile Menu ======== */
.menu-toggle { display: none; background: none; border: none; color: #333; font-size: 22px; cursor: pointer; padding: 2px 6px; line-height: 1; border-radius: 4px; }
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
.mobile-overlay.show { display: block; }

@media (max-width: 768px) {
  .menu-toggle { display: block; margin-right: 8px; }
  
  .dashboard-body { overflow: auto; }
  .app-layout { position: relative; min-height: 100vh; height: auto; }
  
  .sidebar { position: fixed; top: 0; left: 0; width: 150px; height: 100vh; z-index: 100; 
             transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar.open { transform: translateX(0); }
  
  .sidebar-header { padding: 14px 16px; }
  .sidebar-header h2 { font-size: 15px; }
  .sidebar-footer { padding: 10px 16px; }
  
  .main-content { margin-left: 0; width: 100%; overflow: visible; }
  .content-header { padding: 10px 16px; }
  .content-header h3 { font-size: 15px; }
  .content-body { padding: 8px; overflow: visible; }
  .dashboard-home .content-body { padding: 0; }
  .dashboard-grid { padding: 10px; min-height: 100vh; }
  .dashboard-hero { min-height: calc(100vh - 20px); grid-template-columns: 1fr; gap: 20px; padding: 28px 20px; align-content: center; }
  .hero-copy { flex-direction: column; align-items: flex-start; gap: 14px; }
  .dashboard-logo { width: 86px; height: 86px; border-radius: 18px; }
  .hero-copy h2 { font-size: 30px; }
  .dashboard-slogan { display:none; }
  .dashboard-footnote { left: 20px; bottom: 18px; }
  
  .module-toolbar { flex-wrap: wrap; gap: 6px; }
  .module-toolbar .search-input { max-width: 100%; }
  .module-toolbar .btn { font-size: 12px; padding: 5px 10px; }
  .ops-head { align-items:flex-start; flex-direction:column; }
  .ops-actions { justify-content:flex-start; }
  .ops-date, .ops-search { width:100%; max-width:100%; }
  .ops-stat-grid { grid-template-columns:repeat(2,minmax(120px,1fr)); }
  .ops-service-frame { height:calc(100vh - 160px); min-height:420px; }
  
  .data-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table th { padding: 6px 8px; font-size: 11px; white-space: nowrap; }
  .data-table td { padding: 5px 8px; font-size: 12px; white-space: nowrap; }
  .action-cell .btn { font-size: 11px; padding: 3px 6px; }
  .store-preparation-intro { padding: 10px 12px; font-size: 12px; }
  .equipment-table { display: block; min-width: 0 !important; table-layout: auto !important; }
  .equipment-table thead { display: none; }
  .equipment-table tbody { display: block; }
  .equipment-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-bottom: 10px; padding: 12px; border: 1px solid #dfe8e1; border-radius: 9px; background: #fff; box-shadow: 0 2px 8px rgba(17, 62, 35, .06); }
  .equipment-table tbody td { display: block; padding: 7px 0 !important; border: 0; white-space: normal !important; }
  .equipment-table .equipment-id-cell { display: none; }
  .equipment-table .equipment-main-cell { grid-column: 1 / -1; padding-top: 0 !important; }
  .equipment-table .equipment-price-cell,
  .equipment-table .equipment-channel-cell,
  .equipment-table .equipment-link-cell,
  .equipment-table .equipment-updated-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .equipment-table .equipment-price-cell::before,
  .equipment-table .equipment-channel-cell::before,
  .equipment-table .equipment-link-cell::before,
  .equipment-table .equipment-updated-cell::before { flex: 0 0 auto; color: #718076; font-size: 11px; font-weight: 400; }
  .equipment-table .equipment-price-cell::before { content: "参考价格"; }
  .equipment-table .equipment-channel-cell::before { content: "采购渠道"; }
  .equipment-table .equipment-link-cell::before { content: "采购链接"; }
  .equipment-table .equipment-updated-cell::before { content: "更新时间"; }
  .equipment-table .equipment-link-cell,
  .equipment-table .equipment-updated-cell { grid-column: 1 / -1; }
  .equipment-table .equipment-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; padding-top: 10px !important; border-top: 1px solid #edf2ed; }
  .equipment-table .equipment-actions .btn { flex: 1 1 70px; margin: 0 !important; min-height: 32px; }
  .equipment-table .empty-row { grid-column: 1 / -1; text-align: center; }
  .equipment-thumb, .equipment-thumb-empty { flex-basis: 64px; width: 64px; height: 64px; }
  .ingredient-table { display: block; min-width: 0 !important; table-layout: auto !important; }
  .ingredient-table thead { display: none; }
  .ingredient-table tbody { display: block; }
  .ingredient-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-bottom: 10px; padding: 12px; border: 1px solid #dfe8e1; border-radius: 9px; background: #fff; box-shadow: 0 2px 8px rgba(17, 62, 35, .06); }
  .ingredient-table tbody td { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 0 !important; border: 0; white-space: normal !important; }
  .ingredient-table .ingredient-id-cell { display: none; }
  .ingredient-table .ingredient-name-cell { grid-column: 1 / -1; padding-top: 0 !important; font-size: 14px; }
  .ingredient-table .ingredient-name-cell strong { white-space: normal; }
  .ingredient-table .ingredient-supplier-cell,
  .ingredient-table .ingredient-link-cell { grid-column: 1 / -1; }
  .ingredient-table .ingredient-category-cell::before,
  .ingredient-table .ingredient-supplier-cell::before,
  .ingredient-table .ingredient-quantity-cell::before,
  .ingredient-table .ingredient-price-cell::before,
  .ingredient-table .ingredient-channel-cell::before,
  .ingredient-table .ingredient-link-cell::before { flex: 0 0 auto; color: #718076; font-size: 11px; font-weight: 400; }
  .ingredient-table .ingredient-category-cell::before { content: "分类"; }
  .ingredient-table .ingredient-supplier-cell::before { content: "供应商"; }
  .ingredient-table .ingredient-quantity-cell::before { content: "规格"; }
  .ingredient-table .ingredient-price-cell::before { content: "单价"; }
  .ingredient-table .ingredient-channel-cell::before { content: "渠道"; }
  .ingredient-table .ingredient-link-cell::before { content: "采购链接"; }
  .ingredient-table .ingredient-actions { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 3px; padding-top: 10px !important; border-top: 1px solid #edf2ed; }
  .ingredient-table .ingredient-actions .btn { flex: 1 1 90px; margin: 0 !important; min-height: 32px; }
  .ingredient-table .empty-row { grid-column: 1 / -1; justify-content: center; text-align: center; }
  .equipment-form-layout, .equipment-detail-layout { grid-template-columns: 1fr; }
  .equipment-image-box { width: 140px; height: 140px; }
  .equipment-detail-image, .equipment-detail-image-empty { max-height: 300px; aspect-ratio: 16/10; }
  
  .welcome-card { padding: 16px; }
  .welcome-card h2 { font-size: 16px; }
  
  .modal { width: 95%; margin: 8px; max-height: 90vh; }
  .modal-body { padding: 10px; }
  .modal-xwide { max-width: 100% !important; }
  
  .form-row { flex-direction: column; gap: 0; }
  .form-group { margin-bottom: 10px; }
  .form-group label { font-size: 12px; }
  
  .detail-popup { width: 95%; max-width: 95%; }
  
  .login-container { padding: 10px; }
  .login-card { padding: 20px; }
  
  .tableware-grid { grid-template-columns: 1fr 1fr; }
  .content-factory-shell { grid-template-columns: 1fr; }
  .cf-input-panel { position: static; grid-row: auto; }
  .cf-form-grid { grid-template-columns: 1fr; }
  .cf-creator-grid { grid-template-columns: 1fr; }
  .cf-media-row { grid-template-columns: 44px 1fr; }
  .cf-media-row .cf-actions { grid-column: 1 / -1; }
  .cf-calendar { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

@media (max-width: 480px) {
  .sidebar { width: 150px; }
  .sidebar-header { padding: 10px 12px; }
  .sidebar-header h2 { font-size: 14px; }
  .sidebar-nav .nav-item { padding: 8px 12px; font-size: 12px; }
  .content-header { padding: 8px 12px; }
  .dashboard-hero { padding: 24px 16px; border-radius: 14px; }
  .hero-copy h2 { font-size: 26px; }
  .hero-copy p { font-size: 14px; }
  .data-table th { font-size: 10px; padding: 4px 6px; }
  .data-table td { font-size: 11px; padding: 3px 6px; }
  .tableware-grid { grid-template-columns: 1fr; }
  .cf-calendar { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .sidebar-footer, .menu-toggle, .module-toolbar, .content-header, .action-cell { display: none !important; }
  .main-content, .content-body { overflow: visible; }
  .data-table-wrapper { box-shadow: none; border: 1px solid #ddd; }
}
