﻿/* ======== 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-sub-item { padding-left: 28px; font-size: 12px; }
.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-body { padding: 0; background: #f4f7f3; }

/* ======== 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; white-space:nowrap; flex:0 0 auto; }

.table-pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border-top:1px solid #edf1ee; background:#fff; color:#475569; font-size:13px; }
.table-pagination[hidden] { display:none!important; }
.table-pagination-size,.table-pagination-nav { display:flex; align-items:center; gap:8px; }
.table-pagination-select,.table-pagination-button { min-height:32px; border:1px solid #d6dfd9; border-radius:6px; background:#fff; color:#1f2937; font:inherit; }
.table-pagination-select { padding:4px 28px 4px 9px; }
.table-pagination-button { padding:5px 11px; cursor:pointer; }
.table-pagination-button:hover:not(:disabled) { border-color:#008043; color:#00743c; background:#f1faf5; }
.table-pagination-button:disabled { color:#aab4ae; background:#f5f7f6; cursor:not-allowed; }
.table-pagination-status { min-width:128px; text-align:center; white-space:nowrap; }
@media (max-width:600px) {
  .table-pagination { flex-wrap:wrap; }
  .table-pagination-nav { width:100%; justify-content:space-between; }
  .table-pagination-status { min-width:0; }
}
.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; }

/* ======== 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; display: flex; gap: 6px; }

/* ======== Store Preparation Equipment ======== */
.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 { min-width: 220px; white-space: nowrap !important; }
.equipment-actions .btn { margin: 0 !important; }
.equipment-actions .btn + .btn { margin-left: 6px !important; }
.equipment-link { color: #006b34; text-decoration: underline; text-underline-offset: 2px; }
.equipment-link:hover { color: #004c25; }
.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 { max-width: 100%; border-radius: 10px; border: 1px solid #dfe8e1; }
.equipment-detail-image { display: block; width: auto; height: auto; max-height: 60vh; margin: 0 auto; object-fit: contain; cursor: zoom-in; background: #f7faf7; }
.equipment-detail-image-empty { display: flex; width: 100%; align-items: center; justify-content: center; aspect-ratio: 4/3; 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; }

/* Full-size images inside detail dialogs must remain complete. Cropping is reserved for list thumbnails. */
.detail-media-card { min-width: 0; }
.detail-media-button {
  display: flex;
  width: 100%;
  min-height: 180px;
  max-height: 60vh;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 6px;
  background: #f7faf7;
  cursor: zoom-in;
}
.detail-media-button:focus-visible { outline: 2px solid #08783e; outline-offset: 2px; }
.detail-media-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border-radius: 6px;
}
.detail-media-button.is-compact { min-height: 120px; max-height: 300px; }
.detail-media-button.is-compact .detail-media-image { max-height: 280px; }
.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; }

/* ======== 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; }
.finance-entry-row .finance-amount-group { flex: 0 0 96px; min-width: 96px; }

/* ======== 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; }
.process-tabs { display: flex; gap: 8px; margin-bottom: 12px; padding: 4px; border: 1px solid #dbe7dd; border-radius: 8px; background: #f6faf7; width: fit-content; max-width: 100%; }
.process-tab { appearance: none; border: 0; border-radius: 6px; background: transparent; color: #315541; cursor: pointer; font-size: 14px; font-weight: 600; padding: 9px 18px; }
.process-tab:hover { background: #eaf4ed; }
.process-tab.active { background: #08783e; color: #fff; box-shadow: 0 1px 3px rgba(0, 80, 42, .18); }
.process-content-cell { max-width: 520px; white-space: pre-wrap; word-break: break-word; line-height: 1.65; }
.process-preview-row { margin-top: 6px; line-height: 1.55; }
.process-weight-input { display: flex; align-items: center; gap: 6px; flex: 0 0 180px; }
.process-weight-input span { color: #667; font-size: 13px; }
.form-help { color: #667; font-size: 12px; margin: 5px 0 10px; }
@media (max-width: 700px) {
  .process-tabs { width: 100%; }
  .process-tab { flex: 1; padding: 9px 6px; }
  .recipe-item.proc-ing { align-items: stretch; flex-wrap: wrap; }
  .process-weight-input { flex: 1 1 130px; }
}

/* ======== 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; }

/* ======== Content Factory V2: fidelity-first image workflow ======== */
.module-content[hidden] { display: none !important; }
.content-factory-v2 [hidden] { display: none !important; }
.cf-page-head { background: #fff; padding: 13px 15px; }
.cf-page-head strong { font-size: 18px; }
.cf-safety-pill { flex: 0 0 auto; border: 1px solid #ffd8bf; border-radius: 999px; padding: 7px 12px; color: #ad4e00; background: #fff7e6; font-size: 12px; font-weight: 600; }
.cf-workspace-nav { position: sticky; top: -1px; z-index: 12; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; border: 1px solid #dfe8df; border-radius: 8px; padding: 8px; background: rgba(255,255,255,.96); box-shadow: 0 4px 14px rgba(23,51,33,.06); backdrop-filter: blur(8px); }
.cf-workspace-tab { min-width: 0; border: 1px solid transparent; border-radius: 7px; padding: 8px 12px; color: #53665a; background: #f5f8f5; text-align: left; cursor: pointer; }
.cf-workspace-tab strong, .cf-workspace-tab small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-workspace-tab strong { color: inherit; font-size: 13px; }
.cf-workspace-tab small { margin-top: 3px; color: #7a897e; font-size: 11px; }
.cf-workspace-tab:hover { border-color: #a9cfb7; color: #006b34; background: #f3faf5; }
.cf-workspace-tab.is-active { border-color: #71b88c; color: #006b34; background: #eaf7ee; box-shadow: inset 0 0 0 1px rgba(0,107,52,.06); }
.cf-workspace-tab.is-locked strong { color: #8a4b13; }
.cf-workspace-tab.is-locked { background: #fff9f0; }
.cf-status-banner { margin-bottom: 10px; border: 1px solid #d7e4da; border-left: 4px solid #006b34; border-radius: 8px; padding: 9px 12px; color: #31543e; background: #f7fbf7; line-height: 1.5; }
.cf-status-banner.is-warning { border-color: #ffe7ba; border-left-color: #fa8c16; color: #7a4a00; background: #fffbe6; }
.cf-status-banner.is-error { border-color: #ffccc7; border-left-color: #cf1322; color: #820014; background: #fff2f0; }
.cf-status-banner.is-ready { border-color: #b7eb8f; border-left-color: #389e0d; color: #135200; background: #f6ffed; }

.cf-stepper { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 0; list-style: none; margin: 0 0 10px; padding: 10px 12px; border: 1px solid #dfe8df; border-radius: 8px; background: #fff; overflow-x: auto; }
.cf-stepper li { min-width: 130px; display: flex; align-items: center; gap: 8px; position: relative; padding: 4px 18px 4px 0; color: #7d8c80; }
.cf-stepper li:not(:last-child)::after { content: ""; position: absolute; right: 7px; top: 50%; width: 18px; height: 1px; background: #d6dfd8; }
.cf-stepper li > span { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; display: grid; place-items: center; border: 1px solid #cdd8d0; background: #f2f5f3; color: #617064; font-weight: 700; }
.cf-stepper li div { min-width: 0; }
.cf-stepper strong, .cf-stepper small { display: block; }
.cf-stepper strong { color: inherit; font-size: 13px; white-space: nowrap; }
.cf-stepper small { margin-top: 2px; font-size: 11px; line-height: 1.35; white-space: nowrap; }
.cf-stepper li.is-current { color: #006b34; }
.cf-stepper li.is-current > span { border-color: #006b34; background: #006b34; color: #fff; }
.cf-stepper li.is-complete { color: #31543e; }
.cf-stepper li.is-complete > span { border-color: #85c59e; background: #e9f7ee; color: #006b34; }

.content-factory-v2 { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(300px, .85fr); gap: 10px; align-items: start; }
.cf-workflow-main, .cf-workflow-side { display: grid; gap: 10px; }
.cf-workflow-side { position: sticky; top: 0; }
.content-factory-v2 .cf-panel { padding: 14px; }
.content-factory-v2 .cf-panel-head > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.content-factory-v2 .cf-panel-head h4 { margin: 0; }
.content-factory-v2 .cf-panel-head small { color: #718076; line-height: 1.4; text-align: right; }
.cf-section-number { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border-radius: 50%; background: #e8f5ec; color: #006b34; font-weight: 700; font-size: 12px; }

.cf-upload-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.cf-upload-card { min-width: 0; border: 1px solid #dfe8df; border-radius: 9px; padding: 10px; background: #fcfdfc; }
.cf-upload-card.is-uploading { border-color: #91c6a5; box-shadow: 0 0 0 2px rgba(0,107,52,.08); }
.cf-upload-card.is-ready { border-color: #85c59e; background: #f8fff9; }
.cf-upload-card.is-error { border-color: #ffccc7; background: #fff8f7; }
.cf-upload-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.cf-upload-card-head strong { color: #173321; font-size: 13px; }
.cf-upload-card-head span { color: #788878; font-size: 10px; text-align: right; }
.cf-upload-preview { height: 170px; display: grid; place-items: center; overflow: hidden; border: 1px dashed #cbd8ce; border-radius: 8px; color: #7b897e; background: #f5f8f5; text-align: center; line-height: 1.55; padding: 8px; }
.cf-upload-preview img { width: 100%; height: 100%; display: block; object-fit: contain; }
.cf-mask-preview { background: #e9ecea; }
.cf-mask-preview img { image-rendering: auto; filter: grayscale(1); }
.cf-file-button { display: flex; justify-content: center; margin-top: 8px; cursor: pointer; }
.cf-hidden-file { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.cf-upload-card > small { display: block; margin-top: 6px; min-height: 32px; color: #788878; line-height: 1.45; word-break: break-word; }
.cf-field-help { display: block; margin-top: 5px; color: #758278; line-height: 1.4; }
.cf-inline-field-action { margin-top: 6px; }
.cf-mask-guide { margin-top: 10px; border: 1px solid #dce6de; border-radius: 8px; padding: 10px; color: #31543e; background: #fbfdfb; line-height: 1.5; }
.cf-mask-guide > strong, .cf-mask-guide > small { display: block; }
.cf-mask-guide > small { margin-top: 6px; color: #69786d; }
.cf-mask-guide-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 7px; }
.cf-mask-guide-rules span { display: flex; align-items: flex-start; gap: 7px; }
.cf-mask-guide-rules i { width: 18px; height: 18px; flex: 0 0 18px; border: 1px solid #98a49b; border-radius: 3px; }
.cf-mask-guide-rules i.is-white { background: #fff; }
.cf-mask-guide-rules i.is-black { border-color: #111; background: #111; }
.cf-source-confirmations { display: grid; gap: 7px; margin-top: 10px; border-radius: 8px; padding: 10px; background: #f6faf7; }
.cf-source-confirmations label, .cf-lock-grid label, .cf-review-checklist label { display: flex; align-items: flex-start; gap: 7px; line-height: 1.45; color: #31543e; }
.cf-source-confirmations input, .cf-lock-grid input, .cf-review-checklist input { margin-top: 2px; accent-color: #006b34; }
.cf-source-kind-group { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; border: 1px solid #dce6de; border-radius: 8px; padding: 9px 10px; background: #fff; }
.cf-source-kind-group legend { padding: 0 5px; color: #31543e; font-size: 12px; font-weight: 600; }
.cf-source-kind-group label { display: flex; align-items: flex-start; gap: 6px; border-radius: 6px; padding: 5px 8px; color: #31543e; cursor: pointer; }
.cf-source-kind-group label:has(input:checked) { color: #006b34; background: #edf8f1; font-weight: 600; }
.cf-source-kind-group input { margin-top: 2px; accent-color: #006b34; }
.cf-ugc-intake { margin-top: 10px; border: 1px solid #ffe7ba; border-radius: 8px; padding: 10px; background: #fffdf5; }
.cf-ugc-intake > .cf-lock-note { margin-top: 0; border-left-color: #fa8c16; background: #fff8e8; }
.cf-ugc-intake > label, .cf-ugc-subject-confirm { display: flex; align-items: flex-start; gap: 7px; margin: 9px 0; color: #31543e; line-height: 1.45; }
.cf-ugc-intake input, .cf-ugc-review-fieldset input { accent-color: #006b34; }
.cf-ugc-scope-list, .cf-ugc-platform-list { grid-template-columns: 1fr 1fr; }
.cf-ugc-review-panel { border-color: #ffd591; }
.cf-ugc-review-fieldset { min-width: 0; margin: 10px 0 0; border: 0; padding: 0; }
.cf-ugc-review-fieldset[disabled] { opacity: .64; }
.cf-ugc-review-fieldset .cf-review-checklist { grid-template-columns: 1fr 1fr; }
.cf-ugc-review-fieldset .cf-review-checklist legend { grid-column: 1 / -1; }
.cf-poster-source-notice { border-left: 3px solid #fa8c16; border-radius: 5px; padding: 8px 9px; color: #7a4a00; background: #fffbe6; line-height: 1.5; }
.cf-mask-editor-open { margin-top: 7px; }
.cf-inline-status { min-height: 20px; margin-top: 8px; color: #66766a; font-size: 12px; line-height: 1.55; }
.cf-inline-status.is-error { color: #b42318; }
.cf-inline-status.is-success { color: #06713a; }
.cf-inline-status.is-warning { color: #ad6800; }

.cf-mask-editor-overlay { position: fixed; z-index: 1200; inset: 0; display: grid; place-items: center; padding: 12px; background: rgba(14, 24, 18, .72); }
.cf-mask-editor-overlay[hidden] { display: none !important; }
body.cf-mask-editor-open { overflow: hidden; }
.cf-mask-editor-dialog { width: min(1180px, 100%); max-height: calc(100vh - 24px); display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; border-radius: 12px; background: #fff; box-shadow: 0 20px 50px rgba(0, 0, 0, .28); }
.cf-mask-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e3ebe5; padding: 14px 16px; }
.cf-mask-editor-head h4 { margin: 0; color: #173321; font-size: 17px; }
.cf-mask-editor-head small { display: block; margin-top: 4px; color: #718076; line-height: 1.45; }
.cf-mask-editor-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #edf1ee; padding: 10px 16px; background: #f8fbf9; }
.cf-mask-tool-group { display: flex; flex-wrap: wrap; gap: 7px; }
.cf-mask-brush-control { display: grid; grid-template-columns: auto minmax(120px, 220px) 56px; align-items: center; gap: 8px; color: #31543e; font-size: 12px; font-weight: 600; }
.cf-mask-brush-control input { width: 100%; accent-color: #006b34; }
.cf-mask-brush-control output { color: #006b34; font-variant-numeric: tabular-nums; text-align: right; }
.cf-mask-zoom-control { display: grid; grid-template-columns: auto 120px minmax(94px, auto); align-items: center; gap: 8px; color: #31543e; font-size: 12px; font-weight: 600; }
.cf-mask-zoom-control select { min-width: 0; padding: 6px 8px; }
.cf-mask-zoom-control output { color: #006b34; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-mask-editor-instructions { padding: 9px 16px; color: #31543e; background: #f2faf5; line-height: 1.5; font-size: 12px; }
.cf-mask-canvas-scroll { min-height: 0; height: min(52vh, 620px); flex: 1 1 300px; overflow: auto; display: flex; align-items: flex-start; justify-content: flex-start; padding: 14px; background: #202421; overscroll-behavior: contain; }
.cf-mask-canvas-stage { position: relative; flex: 0 0 auto; max-width: none; margin-inline: auto; overflow: hidden; background: #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, .16); touch-action: none; }
.cf-mask-canvas-stage canvas { display: block; width: 100%; height: 100%; }
#cfMaskSourceCanvas { position: relative; z-index: 1; pointer-events: none; }
#cfMaskPaintCanvas { position: absolute; z-index: 2; inset: 0; cursor: crosshair; touch-action: none; }
#cfMaskBoundaryCanvas { position: absolute; z-index: 3; inset: 0; display: none; pointer-events: none; filter: drop-shadow(0 0 2px #ffea00); }
.cf-mask-canvas-stage.is-pan-mode { touch-action: pan-x pan-y; }
.cf-mask-canvas-stage.is-pan-mode #cfMaskPaintCanvas { cursor: grab; touch-action: pan-x pan-y; }
.cf-mask-canvas-stage.is-pan-mode.is-panning #cfMaskPaintCanvas { cursor: grabbing; }
.cf-mask-canvas-stage.is-overlay-preview #cfMaskPaintCanvas { opacity: .48; }
.cf-mask-canvas-stage:not(.is-overlay-preview) #cfMaskSourceCanvas { visibility: hidden; }
.cf-mask-canvas-stage.is-boundary-preview #cfMaskSourceCanvas { visibility: visible; }
.cf-mask-canvas-stage.is-boundary-preview #cfMaskPaintCanvas { opacity: 0; }
.cf-mask-canvas-stage.is-boundary-preview #cfMaskBoundaryCanvas { display: block; }
.cf-mask-poster-confirm { display: flex; align-items: flex-start; gap: 8px; margin: 10px 16px 0; border: 1px solid #ffd591; border-radius: 8px; padding: 9px 10px; color: #7a4a00; background: #fffbe6; line-height: 1.5; }
.cf-mask-poster-confirm input { margin-top: 3px; accent-color: #006b34; }
.cf-mask-poster-help { display: block; margin: 5px 16px 0; color: #8a6d3b; line-height: 1.45; }
.cf-mask-editor-dialog > .cf-inline-status { margin: 7px 16px 0; }
.cf-mask-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #e3ebe5; margin-top: 8px; padding: 11px 16px; color: #66766a; font-size: 12px; }
.cf-mask-editor-footer .btn { flex: 0 0 auto; }

.cf-lock-grid { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 8px; }
.cf-lock-grid label { border: 1px solid #d7e5da; border-radius: 8px; padding: 9px; background: #f8fcf9; font-weight: 600; }
.cf-lock-grid input[disabled] { opacity: 1; }
.cf-lock-note { margin-top: 10px; border-left: 4px solid #006b34; border-radius: 6px; padding: 9px 10px; color: #31543e; background: #f2faf5; line-height: 1.55; }

.cf-choice-group, .cf-ratio-group, .cf-review-checklist { border: 0; padding: 0; margin: 0 0 10px; min-width: 0; }
.cf-choice-group legend, .cf-ratio-group legend, .cf-review-checklist legend { margin-bottom: 7px; color: #31543e; font-size: 12px; font-weight: 600; }
.cf-choice-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cf-choice-group legend { grid-column: 1 / -1; }
.cf-choice-card { display: flex; align-items: flex-start; gap: 8px; border: 1px solid #dce6de; border-radius: 8px; padding: 10px; cursor: pointer; background: #fff; }
.cf-choice-card:has(input:checked) { border-color: #42a26c; background: #f5fcf7; box-shadow: inset 0 0 0 1px rgba(0,107,52,.08); }
.cf-choice-card:has(input:disabled) { cursor: not-allowed; background: #f6f7f6; opacity: .72; }
.cf-choice-card input { margin-top: 2px; accent-color: #006b34; }
.cf-choice-card strong, .cf-choice-card small, .cf-choice-card em { display: block; }
.cf-choice-card strong { color: #173321; margin-bottom: 3px; }
.cf-choice-card small { color: #758278; line-height: 1.45; }
.cf-choice-card em { margin-top: 5px; color: #8a6d3b; font-size: 11px; font-style: normal; line-height: 1.4; }
.cf-source-exact-choice:not(:has(input:disabled)) em { color: #237804; }
.cf-source-exact-copy { margin: 0 0 10px; border: 1px solid #c9e4d1; border-radius: 9px; padding: 10px; background: #fbfffc; }
.cf-source-exact-copy .cf-lock-note { margin-top: 0; margin-bottom: 10px; }
.cf-ratio-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.cf-ratio-group legend { width: 100%; }
.cf-ratio-group label { border: 1px solid #dce6de; border-radius: 8px; padding: 8px 12px; background: #fff; color: #31543e; cursor: pointer; }
.cf-ratio-group label:has(input:checked) { border-color: #42a26c; background: #f5fcf7; }
.cf-ratio-group input { accent-color: #006b34; }

.cf-compare-viewport { --cf-compare-split: 50%; --cf-zoom: 1; position: relative; height: 460px; overflow: hidden; border: 1px solid #d9e4dc; border-radius: 9px; background: #202421; }
.cf-compare-viewport.is-empty { display: grid; place-items: center; min-height: 260px; height: 320px; background: #f6f8f6; }
.cf-compare-empty { color: #7d8a80; text-align: center; }
.cf-compare-viewport:not(.is-empty) .cf-compare-empty { display: none; }
.cf-compare-viewport.is-empty .cf-compare-image,
.cf-compare-viewport.is-empty .cf-mask-overlay-image,
.cf-compare-viewport.is-empty #cfCompareSlider { display: none; }
.cf-compare-image { position: absolute; inset: 0; overflow: hidden; }
.cf-compare-image span { position: absolute; z-index: 3; top: 10px; left: 10px; border-radius: 5px; padding: 4px 7px; color: #fff; background: rgba(0,0,0,.62); font-size: 11px; }
.cf-compare-image img { width: 100%; height: 100%; object-fit: contain; transform: scale(var(--cf-zoom)); transform-origin: center; }
.cf-after-layer { clip-path: inset(0 calc(100% - var(--cf-compare-split)) 0 0); }
.cf-after-layer span { left: auto; right: 10px; }
#cfCompareSlider { position: absolute; z-index: 5; inset: auto 16px 14px; width: calc(100% - 32px); accent-color: #006b34; }
.cf-mask-overlay-image { position: absolute; z-index: 4; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .38; mix-blend-mode: screen; transform: scale(var(--cf-zoom)); }
.cf-compare-viewport.is-side-by-side { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #fff; }
.cf-compare-viewport.is-side-by-side .cf-compare-image { position: relative; inset: auto; min-width: 0; background: #202421; }
.cf-compare-viewport.is-side-by-side .cf-after-layer { clip-path: none; }
.cf-compare-viewport.is-side-by-side #cfCompareSlider { display: none; }
.cf-compare-viewport.is-side-by-side .cf-mask-overlay-image { grid-column: 1 / -1; pointer-events: none; }
.cf-output-thumbnails { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 8px; margin-top: 9px; }
.cf-output-thumb { border: 1px solid #dce6de; border-radius: 8px; padding: 6px; background: #fff; cursor: pointer; text-align: left; }
.cf-output-thumb.is-selected { border-color: #006b34; box-shadow: 0 0 0 1px #006b34; }
.cf-output-thumb img { width: 100%; height: 92px; display: block; object-fit: cover; border-radius: 5px; background: #f1f4f2; }
.cf-output-thumb span { display: block; margin-top: 5px; color: #31543e; font-size: 11px; }

.cf-auto-checks { display: grid; gap: 7px; margin-bottom: 10px; }
.cf-auto-checks > div { display: flex; justify-content: space-between; gap: 8px; border: 1px solid #e0e8e2; border-radius: 7px; padding: 8px; background: #fafcfb; color: #31543e; }
.cf-auto-checks span { color: #7b897e; text-align: right; }
.cf-auto-checks .is-pass { border-color: #b7eb8f; background: #f6ffed; }
.cf-auto-checks .is-pass span { color: #237804; }
.cf-auto-checks .is-fail { border-color: #ffccc7; background: #fff2f0; }
.cf-auto-checks .is-fail span { color: #cf1322; }
.cf-auto-checks .cf-source-exact-evidence { border-color: #d3c3f1; background: #faf7ff; }
.cf-auto-checks .cf-source-exact-evidence.is-pass { border-color: #95de64; background: #f6ffed; }
.cf-auto-checks .cf-source-exact-evidence.is-fail { border-color: #ff7875; background: #fff1f0; }
.cf-review-checklist { display: grid; gap: 8px; border-top: 1px solid #edf1ee; border-bottom: 1px solid #edf1ee; padding: 10px 0; }
.cf-review-checklist[disabled] { opacity: .62; }
.cf-review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.cf-approved-downloads { display: grid; gap: 8px; }
.cf-approved-downloads a { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid #b7d8c2; border-radius: 8px; padding: 9px 10px; color: #006b34; background: #f6ffed; text-decoration: none; }
.cf-locked-state, .cf-video-locked { border: 1px dashed #cfd9d1; border-radius: 8px; padding: 12px; color: #6f7d72; background: #f8faf8; line-height: 1.5; }
.cf-video-locked { margin-top: 10px; border-color: #ffd8bf; background: #fff9f0; color: #8a4b13; }
.cf-video-locked strong, .cf-video-locked span { display: block; }
.cf-video-locked span { margin-top: 4px; font-size: 12px; }
.cf-job-history { margin-top: 10px; }
#cfImageJobTable .action-cell { white-space: nowrap; }
.cf-video-v1 { margin-top: 10px; }
.cf-video-v1 .cf-panel-head h4 { margin: 0; }
.cf-video-constraint-pill { flex: 0 0 auto; border: 1px solid #b7d8c2; border-radius: 999px; padding: 6px 10px; color: #006b34; background: #f6ffed; font-size: 11px; font-weight: 700; }
.cf-video-v1-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); gap: 14px; margin-top: 12px; }
.cf-video-v1 h5 { margin: 0 0 8px; color: #173321; font-size: 13px; }
.cf-video-v1 h5:not(:first-child) { margin-top: 14px; }
.cf-video-approved-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.cf-video-source-card { display: grid; grid-template-columns: 52px 1fr; gap: 8px; align-items: center; min-width: 0; border: 1px solid #dce6de; border-radius: 8px; padding: 7px; background: #fff; cursor: pointer; }
.cf-video-source-card:has(input:checked) { border-color: #42a26c; background: #f5fcf7; }
.cf-video-source-card:has(input:disabled) { cursor: not-allowed; opacity: .58; }
.cf-video-source-card img { width: 52px; height: 64px; display: block; border-radius: 5px; object-fit: contain; background: #f1f4f2; }
.cf-video-source-card span { min-width: 0; }
.cf-video-source-card strong, .cf-video-source-card small { display: block; overflow: hidden; text-overflow: ellipsis; }
.cf-video-source-card strong { color: #173321; white-space: nowrap; }
.cf-video-source-card small { margin-top: 3px; color: #718076; font-size: 10px; white-space: nowrap; }
.cf-video-source-card input { accent-color: #006b34; }
.cf-video-scene-list { display: grid; gap: 7px; }
.cf-video-scene-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(116px, 150px); gap: 8px; align-items: center; border: 1px solid #dce6de; border-radius: 8px; padding: 8px; background: #fbfdfb; }
.cf-video-scene-row > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #006b34; background: #eaf7ee; font-weight: 700; }
.cf-video-scene-row strong { min-width: 0; overflow: hidden; color: #31543e; text-overflow: ellipsis; white-space: nowrap; }
.cf-video-scene-row label { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px; color: #66766a; font-size: 11px; }
.cf-video-scene-row input { min-width: 0; padding: 7px; }
.cf-video-duration-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; margin: 9px 0; border-radius: 7px; padding: 8px 10px; color: #31543e; background: #f5f8f5; }
.cf-video-duration-summary strong { color: #006b34; font-variant-numeric: tabular-nums; }
.cf-video-duration-summary small { color: #718076; }
.cf-video-duration-summary.is-error strong { color: #cf1322; }
.cf-video-preview { width: min(260px, 100%); max-height: 460px; display: block; margin: 0 auto 9px; border-radius: 8px; background: #111; }
.cf-video-evidence { display: grid; gap: 7px; margin-bottom: 10px; }
.cf-video-evidence-row { border: 1px solid #dfe8df; border-radius: 8px; padding: 8px; background: #fafcfb; color: #31543e; font-size: 11px; line-height: 1.5; }
.cf-video-evidence-row.is-pass { border-color: #b7eb8f; background: #f6ffed; }
.cf-video-evidence-row.is-fail { border-color: #ffccc7; background: #fff2f0; }
.cf-video-evidence-row strong, .cf-video-evidence-row span { display: block; }
.cf-video-evidence-row code { word-break: break-all; }
.cf-video-history { margin-top: 12px; }
#cfVideoApprovedDownload { margin-top: 8px; text-align: center; text-decoration: none; }

@media (max-width: 1200px) {
  .content-factory-shell { grid-template-columns: minmax(280px, 360px) 1fr; }
  .cf-input-panel { grid-row: span 2; }
  .content-factory-v2 { grid-template-columns: minmax(0, 1fr) 320px; }
  .cf-choice-group { grid-template-columns: 1fr; }
  .cf-video-v1-grid { grid-template-columns: 1fr; }
  .cf-upload-grid { grid-template-columns: 1fr 1fr; }
  .cf-upload-grid .cf-upload-card:last-child { grid-column: 1 / -1; }
  .cf-upload-grid .cf-upload-card:last-child .cf-upload-preview { height: 210px; }
}


/* ======== 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; }
  .cf-workspace-nav { position: static; grid-template-columns: 1fr; }
  .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-form-layout, .equipment-detail-layout { grid-template-columns: 1fr; }
  .equipment-image-box { width: 140px; height: 140px; }
  .equipment-detail-image { max-height: 52vh; }
  .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)); }
  .cf-page-head { align-items: flex-start; }
  .cf-safety-pill { white-space: normal; text-align: center; }
  .cf-stepper { grid-template-columns: repeat(5, 132px); }
  .content-factory-v2 { grid-template-columns: 1fr; }
  .cf-workflow-side { position: static; }
  .cf-upload-grid { grid-template-columns: 1fr; }
  .cf-upload-grid .cf-upload-card:last-child { grid-column: auto; }
  .cf-upload-preview, .cf-upload-grid .cf-upload-card:last-child .cf-upload-preview { height: 210px; }
  .cf-lock-grid { grid-template-columns: 1fr 1fr; }
  .cf-mask-guide-rules { grid-template-columns: 1fr; }
  .cf-mask-editor-dialog { max-height: calc(100vh - 12px); }
  .cf-mask-editor-overlay { padding: 6px; }
  .cf-mask-editor-tools { align-items: stretch; }
  .cf-mask-brush-control { grid-template-columns: auto minmax(100px, 1fr) 52px; width: 100%; }
  .cf-mask-zoom-control { grid-template-columns: auto minmax(110px, 1fr) minmax(94px, auto); width: 100%; }
  .cf-choice-group { grid-template-columns: 1fr; }
  .cf-choice-group legend { grid-column: auto; }
  .cf-compare-viewport { height: 420px; }
}

@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; }
  .cf-page-head { display: grid; }
  .cf-safety-pill { justify-self: start; }
  .cf-form-grid, .cf-lock-grid { grid-template-columns: 1fr; }
  .cf-review-actions { grid-template-columns: 1fr; }
  .cf-compare-viewport { height: 360px; }
  .cf-compare-viewport.is-side-by-side { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .cf-panel-head { align-items: flex-start; flex-direction: column; }
  .content-factory-v2 .cf-panel-head small { text-align: left; }
  .cf-source-kind-group { display: grid; }
  .cf-ugc-scope-list, .cf-ugc-platform-list, .cf-ugc-review-fieldset .cf-review-checklist { grid-template-columns: 1fr; }
  .cf-ugc-review-fieldset .cf-review-checklist legend { grid-column: auto; }
  .cf-mask-editor-head { padding: 11px 12px; }
  .cf-mask-editor-tools { padding: 9px 12px; }
  .cf-mask-zoom-control { grid-template-columns: auto 1fr; }
  .cf-mask-zoom-control output { grid-column: 2; }
  .cf-mask-tool-group { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .cf-mask-tool-group:last-child { grid-template-columns: repeat(2, 1fr); }
  .cf-mask-tool-group .btn { min-width: 0; white-space: normal; }
  .cf-mask-editor-instructions { padding: 8px 12px; }
  .cf-mask-canvas-scroll { min-height: 0; height: 42vh; flex-basis: 210px; padding: 8px; }
  .cf-mask-poster-confirm, .cf-mask-poster-help, .cf-mask-editor-dialog > .cf-inline-status { margin-left: 12px; margin-right: 12px; }
  .cf-mask-editor-footer { align-items: stretch; flex-direction: column; padding: 10px 12px; }
  .cf-mask-editor-footer .btn { width: 100%; }
}

@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; }
}
