@import url('https://fonts.googleapis.com/css2?family=K2D:wght@300;400;500;600;700&display=swap');

:root {
  --forest: #38213f;
  --plum: #64466d;
  --forest-2: #4b3154;
  --forest-3: #70517a;
  --mint: #d8c9dd;
  --mint-pale: #f2edf3;
  --sand: #a68a51;
  --rose: #e16f94;
  --blue: #9475b4;
  --paper: #fffefa;
  --canvas: #f6f4ef;
  --ink: #302a33;
  --muted: #746b77;
  --line: #e5dfd7;
  --danger: #b34c4c;
  --shadow: 0 8px 26px rgba(42, 29, 45, .045);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-family: 'K2D', sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; min-height: 100vh; }
button, input, textarea { font: inherit; }
button, label[for], .upload-box, .drop-file { cursor: pointer; }

.app { min-height: 100vh; display: grid; grid-template-columns: 238px 1fr; }
.guest-mode .sidebar { display: none; }
.guest-mode .content { grid-column: 1 / -1; width: min(1320px, 100%); margin: 0 auto; }
.guest-mode .menu-button { display: none; }
.sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: 238px; display: flex; flex-direction: column; padding: 30px 18px 20px; background: linear-gradient(180deg, #3c1045 0%, #55205e 60%, #6a2c6d 100%); color: white; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 11px 34px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 13px; letter-spacing: 0; line-height: 1.25; }
.brand small { margin-top: 4px; color: rgba(255,255,255,.52); font-size: 9px; letter-spacing: 0; }
.brand-symbol { position: relative; width: 40px; height: 40px; }
.brand-symbol span { position: absolute; width: 18px; height: 30px; border-radius: 18px 18px 3px 18px; background: var(--mint); transform-origin: 100% 100%; }
.brand-symbol span:nth-child(1) { left: 2px; top: 1px; transform: rotate(-28deg); }
.brand-symbol span:nth-child(2) { right: 2px; top: 1px; transform: rotate(28deg) scaleX(-1); background: #f0c56e; }
.brand-symbol span:nth-child(3) { width: 14px; height: 24px; left: 13px; bottom: 0; transform: rotate(45deg); background: #b96393; }
.main-nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 13px; color: rgba(255,255,255,.62); background: transparent; border: 0; border-radius: 10px; text-align: left; transition: .18s ease; }
.nav-link:hover, .nav-link.active { color: white; background: rgba(255,255,255,.1); }
.nav-link.active { box-shadow: inset 3px 0 var(--mint); }
.nav-icon { width: 22px; font-size: 19px; text-align: center; }
.sidebar-spacer { flex: 1; }
.local-badge { display: flex; align-items: flex-start; gap: 10px; padding: 13px; margin-top: 9px; border-radius: 10px; background: rgba(0,0,0,.13); }
.local-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #91d5ad; box-shadow: 0 0 0 4px rgba(145,213,173,.12); }
.local-badge strong, .local-badge small { display: block; }
.local-badge strong { font-size: 11px; }
.local-badge small { margin-top: 3px; color: rgba(255,255,255,.47); font-size: 8px; }

.content { grid-column: 2; min-width: 0; padding: 0 38px 50px; }
.topbar { min-height: 106px; display: flex; align-items: center; gap: 15px; }
.menu-button { display: none; background: none; border: 0; font-size: 23px; }
.page-kicker, .section-kicker { display: block; color: var(--forest-3); font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.page-identity h1 { margin: 3px 0 0; font-size: 24px; font-weight: 600; }
.page-organization { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 13px; }
.today-pill { padding-right: 17px; text-align: right; border-right: 1px solid var(--line); }
.today-pill span, .today-pill strong { display: block; }
.today-pill span { color: var(--muted); font-size: 9px; }
.today-pill strong { font-size: 11px; font-weight: 500; }

.primary-button, .secondary-button, .danger-button, .ghost-light-button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 39px; padding: 9px 15px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 11px; transition: .18s ease; }
.primary-button { color: white; background: var(--forest); box-shadow: 0 7px 18px rgba(25,60,53,.17); }
.primary-button:hover { background: var(--forest-2); transform: translateY(-1px); }
.secondary-button { color: var(--ink); background: white; border-color: var(--line); }
.secondary-button:hover { border-color: #bfc8c3; }
.danger-button { color: white; background: var(--danger); }
.ghost-light-button { color: white; background: transparent; border-color: rgba(255,255,255,.3); }
.text-button { border: 0; background: transparent; color: var(--forest-3); font-size: 10px; font-weight: 600; }
.full-width { width: 100%; }

.page { display: none; animation: pageIn .25s ease; }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(5px); } }

.hero-card { min-height: 202px; position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 32px 34px; overflow: hidden; border-radius: 19px; color: white; background: linear-gradient(118deg, #531b61 0%, #783176 58%, #a84e75 100%); box-shadow: var(--shadow); }
.hero-copy { position: relative; z-index: 2; }
.hero-tag { display: inline-block; margin-bottom: 10px; padding: 5px 9px; border: 1px solid rgba(255,255,255,.22); border-radius: 20px; color: #f5c9da; font-size: 8px; letter-spacing: .14em; }
.hero-copy h2 { margin: 0; font-size: clamp(25px, 3vw, 37px); font-weight: 500; line-height: 1.22; }
.hero-copy h2 em { color: #f1ca75; font-style: normal; }
.hero-copy p { max-width: 580px; margin: 11px 0 0; color: rgba(255,255,255,.58); font-size: 10px; }
.hero-controls { position: relative; z-index: 2; min-width: 300px; display: grid; gap: 9px; }
.period-switch { display: grid; grid-template-columns: repeat(4,1fr); padding: 3px; border-radius: 8px; background: rgba(0,0,0,.2); }
.period-switch button { padding: 6px; border: 0; border-radius: 6px; color: rgba(255,255,255,.58); background: transparent; font-size: 10px; }
.period-switch button.active { color: var(--forest); background: white; font-weight: 600; }
.period-input-wrap { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(0,0,0,.12); }
.period-input-wrap[hidden] { display: none; }
.period-input-wrap span { color: rgba(255,255,255,.55); font-size: 9px; }
.period-input-wrap input { width: 125px; border: 0; outline: 0; background: transparent; color: white; font-size: 10px; color-scheme: dark; }
.hero-pattern { position: absolute; right: 13%; top: -64%; width: 330px; height: 330px; border: 1px solid rgba(255,255,255,.06); border-radius: 50%; }
.hero-pattern::before, .hero-pattern::after { content: ''; position: absolute; inset: 45px; border: 1px solid rgba(255,255,255,.055); border-radius: 50%; }
.hero-pattern::after { inset: 90px; }
.guest-mode .hero-card { min-height: 160px; align-items: center; color: var(--ink); background: linear-gradient(135deg, #fff 0%, #fbf4f8 100%); border: 1px solid var(--line); box-shadow: 0 10px 35px rgba(69,22,77,.055); }
.guest-mode .hero-tag { color: var(--forest-3); background: var(--mint-pale); border-color: transparent; }
.guest-mode .hero-copy h2 { font-size: clamp(25px, 3vw, 34px); }
.guest-mode .hero-copy h2 em { color: var(--forest-3); }
.guest-mode .hero-copy p { color: var(--muted); }
.guest-mode .hero-pattern { display: none; }
.public-grand-total { position: relative; z-index: 2; min-width: 245px; padding: 18px 24px; border: 1px solid #eadce8; border-radius: 16px; background: white; box-shadow: 0 12px 32px rgba(69,22,77,.08); }
.public-grand-total > span { display: block; color: var(--muted); font-size: 9px; }
.public-grand-total > div { display: flex; align-items: baseline; gap: 8px; margin-top: 5px; }
.public-grand-total strong { color: var(--forest); font-size: clamp(35px, 4vw, 52px); line-height: 1; }
.public-grand-total small { color: var(--muted); font-size: 10px; }
.guest-mode .period-switch { background: #f1e7ef; }
.guest-mode .period-switch button { color: var(--muted); }
.guest-mode .period-switch button.active { color: white; background: var(--forest); }
.guest-mode .period-input-wrap { color: var(--ink); background: white; border-color: var(--line); }
.guest-mode .period-input-wrap span { color: var(--muted); }
.guest-mode .period-input-wrap input { color: var(--ink); color-scheme: light; }
.guest-mode .ghost-light-button { color: var(--forest); background: white; border-color: var(--line); }
.guest-mode .flower-overview { margin-top: 17px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin: 17px 0; }
.metric-card { min-height: 150px; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 6px 25px rgba(26,55,48,.035); }
.metric-primary { color: white; background: var(--forest-2); border-color: transparent; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 9px; }
.metric-primary .metric-top, .metric-primary p { color: rgba(255,255,255,.62); }
.metric-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: var(--forest); background: var(--mint); font-size: 13px; }
.soft-blue { color: #4d8098; background: #e5f0f4; }
.soft-gold { color: #9b7839; background: #f3ead7; }
.soft-rose { color: #a75d56; background: #f5e4e1; }
.metric-value { margin-top: 10px; }
.metric-value strong { font-size: 31px; line-height: 1; font-weight: 600; }
.metric-value small { margin-left: 6px; color: var(--muted); font-size: 10px; }
.metric-primary .metric-value small { color: rgba(255,255,255,.58); }
.metric-card p { margin: 13px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.metric-progress { height: 4px; margin-top: 16px; overflow: hidden; border-radius: 6px; background: rgba(255,255,255,.14); }
.metric-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: #f0c66e; transition: width .4s ease; }

.dashboard-grid { display: grid; gap: 17px; }
.flower-overview { margin-bottom: 17px; }
.flower-total-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; padding: 0 20px 20px; }
.flower-total-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 9px 24px rgba(69,22,77,.055); }
.flower-photo { position: relative; height: 148px; overflow: hidden; background: #eee8e5; }
.flower-photo img, .flower-photo svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.flower-photo::after { content: ''; position: absolute; inset: auto 0 0; height: 45%; background: linear-gradient(transparent, rgba(31,12,34,.22)); pointer-events: none; }
.flower-photo > span { position: absolute; z-index: 2; left: 10px; top: 10px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: white; background: rgba(69,22,77,.86); backdrop-filter: blur(5px); font-size: 8px; font-weight: 700; }
.flower-card-copy { min-width: 0; padding: 13px 14px 14px; }
.flower-card-copy small, .flower-card-copy strong, .flower-card-copy b { display: block; }
.flower-card-copy small { overflow: hidden; color: var(--ink); font-size: 10px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.flower-card-copy strong { margin-top: 5px; color: var(--forest); font-size: 21px; line-height: 1; }
.flower-card-copy em { color: var(--muted); font-size: 8px; font-style: normal; font-weight: 400; }
.flower-card-copy b { margin-top: 9px; color: var(--muted); font-size: 7px; font-weight: 400; }
.flower-reference-note { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 7px; }
.flower-reference-note div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.flower-reference-note a { color: var(--forest-3); font-weight: 600; text-decoration: none; }
.flower-reference-note a:hover { text-decoration: underline; }
.main-grid { grid-template-columns: minmax(0, 1.65fr) minmax(260px, .65fr); }
.lower-grid { grid-template-columns: 1fr; margin-top: 17px; }
.surface { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 7px 28px rgba(26,55,48,.035); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 20px 13px; }
.section-heading h3 { margin: 3px 0 0; font-size: 14px; font-weight: 600; }
.section-note { color: var(--muted); font-size: 8px; }
.ranking-legend { display: flex; gap: 13px; color: var(--muted); font-size: 8px; }
.ranking-legend i { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 2px; }
.legend-report { background: var(--forest-3); }
.legend-flower { background: var(--sand); }
.ranking-list { padding: 0 20px 19px; display: grid; gap: 10px; }
.rank-row { display: grid; grid-template-columns: 24px minmax(120px, 1fr) minmax(130px, 1.6fr) 72px; align-items: center; gap: 10px; font-size: 9px; }
.rank-index { color: var(--muted); font-weight: 600; }
.rank-index.top { color: #c98520; }
.rank-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.rank-bars { display: grid; gap: 3px; }
.mini-track { height: 5px; border-radius: 5px; background: #eff0ec; overflow: hidden; }
.mini-track i { display: block; height: 100%; border-radius: inherit; background: var(--forest-3); }
.mini-track.gold i { background: var(--sand); }
.rank-value { text-align: right; color: var(--muted); }
.rank-value strong { display: block; color: var(--ink); font-size: 10px; }

.coverage-panel { display: flex; flex-direction: column; }
.donut-wrap { flex: 1; display: grid; place-items: center; padding: 8px 0 13px; }
.donut { --value: 0deg; width: 130px; height: 130px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--forest-3) var(--value), #eceee9 0); position: relative; }
.donut::after { content: ''; position: absolute; inset: 15px; border-radius: 50%; background: var(--paper); }
.donut > div { z-index: 1; text-align: center; }
.donut strong, .donut span { display: block; }
.donut strong { font-size: 24px; }
.donut span { color: var(--muted); font-size: 8px; }
.coverage-stats { display: grid; grid-template-columns: 1fr 1fr; margin: 0 20px 20px; border-top: 1px solid var(--line); }
.coverage-stats > div { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; padding: 12px 4px 0; font-size: 8px; color: var(--muted); }
.coverage-stats > div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.coverage-stats strong { color: var(--ink); font-size: 12px; }
.coverage-stats i { width: 7px; height: 7px; border-radius: 50%; }
.complete-dot { background: var(--forest-3); }
.pending-dot { background: #d9dcd6; }

.chart-wrap { height: 205px; display: flex; gap: 10px; padding: 8px 20px 20px; }
.y-axis { display: flex; flex-direction: column; justify-content: space-between; color: #adb3b0; font-size: 7px; text-align: right; }
.bar-chart { flex: 1; display: flex; align-items: stretch; gap: 5px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), #edf0eb 25%); }
.bar-item { min-width: 8px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; }
.bar-value { width: min(15px, 70%); min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--mint), var(--forest-3)); transition: height .4s ease; }
.bar-label { height: 11px; color: var(--muted); font-size: 7px; }
.latest-list { padding: 0 19px 18px; display: grid; gap: 8px; }
.latest-item { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 9px; border: 0; border-radius: 9px; color: var(--ink); background: #f7f8f4; text-align: left; }
.latest-item:hover { background: var(--mint-pale); }
.latest-date { padding: 4px 2px; border-radius: 7px; text-align: center; color: var(--forest); background: var(--mint-pale); }
.latest-date strong, .latest-date small { display: block; line-height: 1.1; }
.latest-date strong { font-size: 12px; }.latest-date small { font-size: 7px; }
.latest-info { min-width: 0; }
.latest-info strong, .latest-info small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.latest-info strong { font-size: 9px; }.latest-info small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.latest-total { text-align: right; }.latest-total strong, .latest-total small { display: block; }.latest-total strong { font-size: 10px; }.latest-total small { color: var(--muted); font-size: 7px; }

.entry-layout { display: grid; grid-template-columns: 290px minmax(0, 760px); justify-content: center; gap: 28px; align-items: start; }
.entry-intro { position: sticky; top: 25px; padding: 35px 20px 20px 4px; }
.entry-number { display: block; color: #daddd7; font-size: 58px; font-weight: 300; line-height: 1; }
.entry-intro h2 { margin: 8px 0 12px; font-size: 36px; font-weight: 500; line-height: 1.2; }
.entry-intro > p { color: var(--muted); font-size: 11px; line-height: 1.8; }
.entry-tip { display: flex; gap: 10px; margin-top: 25px; padding: 13px; border-radius: 10px; background: var(--mint-pale); }
.entry-tip > span { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--forest-3); font-size: 10px; }
.entry-tip p { margin: 0; color: #704f70; font-size: 8px; line-height: 1.6; }
.report-form { padding: 25px; }
.form-section-title { display: flex; align-items: center; gap: 13px; margin: 5px 0 16px; color: var(--forest); font-size: 11px; font-weight: 600; }
.form-section-title:not(:first-of-type) { margin-top: 27px; }
.form-section-title i { flex: 1; height: 1px; background: var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field { display: grid; gap: 6px; color: #5d4d60; font-size: 9px; font-weight: 500; }
.field.full { grid-column: 1 / -1; }
.field b { color: var(--rose); }
.field input, .field textarea, .compact-field input { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--ink); background: #fff; resize: vertical; font-size: 10px; }
.field input:focus, .field textarea:focus, .compact-field input:focus { border-color: #b57aa9; box-shadow: 0 0 0 3px rgba(125,52,125,.09); }
.field > small { color: var(--muted); font-size: 8px; font-weight: 400; }
.suffix-input { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.suffix-input input { border: 0; border-radius: 0; }
.suffix-input span { display: grid; place-items: center; padding: 0 11px; color: var(--muted); background: #f5f5f1; }
.flower-inputs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.flower-field { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fafaf7; }
.flower-field > span { display: block; margin-bottom: 6px; color: #5d4d60; font-size: 8px; font-weight: 500; }
.flower-field .suffix-input input { min-width: 0; padding: 7px; font-size: 10px; }.flower-field .suffix-input span { padding: 0 7px; font-size: 7px; }
.form-total { display: flex; align-items: center; justify-content: flex-end; gap: 18px; margin-top: 10px; padding: 11px 13px; border-radius: 8px; color: var(--forest); background: var(--mint-pale); font-size: 9px; }
.form-total strong { font-size: 14px; }
.upload-box { min-height: 108px; display: grid; place-items: center; align-content: center; gap: 2px; border: 1px dashed #aebdb6; border-radius: 10px; background: #fafbf8; }
.upload-box.dragging { border-color: var(--forest-3); background: var(--mint-pale); }
.upload-box input { display: none; }.upload-symbol { width: 29px; height: 29px; display: grid; place-items: center; margin-bottom: 3px; border-radius: 50%; color: white; background: var(--forest-3); }.upload-box strong { font-size: 9px; }.upload-box small { color: var(--muted); font-size: 7px; }
.photo-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 9px; }
.photo-thumb { position: relative; aspect-ratio: 4/3; overflow: hidden; border-radius: 8px; background: #eee; }.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }.photo-thumb button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; color: white; background: rgba(0,0,0,.65); }
.photo-help { margin: -6px 0 10px; color: var(--muted); font-size: 8px; }
.photo-slot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.photo-slot { position: relative; aspect-ratio: 4/3; display: grid; place-items: center; align-content: center; gap: 3px; overflow: hidden; border: 1px dashed #aebdb6; border-radius: 10px; color: var(--forest-3); background: #fafbf8; text-align: center; transition: .18s ease; }
.photo-slot:hover { border-color: var(--forest-3); background: var(--mint-pale); }
.photo-slot input { display: none; }
.photo-slot .slot-number { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--forest-3); font-size: 10px; }
.photo-slot strong { font-size: 8px; }.photo-slot small { color: var(--muted); font-size: 7px; }
.photo-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-slot .slot-label { position: absolute; z-index: 2; left: 5px; bottom: 5px; padding: 2px 6px; border-radius: 8px; color: var(--ink); background: rgba(255,255,255,.9); font-size: 7px; }
.photo-slot .remove-slot-photo { position: absolute; z-index: 3; top: 5px; right: 5px; width: 23px; height: 23px; border: 0; border-radius: 50%; color: white; background: rgba(0,0,0,.68); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

.list-toolbar { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; padding: 13px; }
.search-field { min-width: 250px; flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.search-field input { width: 100%; padding: 9px 0; border: 0; outline: 0; font-size: 10px; }
.compact-field { display: grid; gap: 4px; color: var(--muted); font-size: 8px; }.compact-field input { width: 140px; padding: 8px; }.compact-field.full-width input { width: 100%; }
.table-surface { overflow: hidden; }.record-count { padding: 5px 9px; border-radius: 20px; color: var(--forest-3); background: var(--mint-pale); font-size: 8px; font-weight: 600; }
.table-wrap { overflow-x: auto; } table { width: 100%; border-collapse: collapse; } th { padding: 10px 17px; color: var(--muted); background: #f7f8f4; font-size: 8px; font-weight: 500; text-align: left; } td { padding: 12px 17px; border-top: 1px solid var(--line); font-size: 9px; vertical-align: middle; } td strong, td small { display: block; } td small { color: var(--muted); font-size: 7px; margin-top: 2px; }.table-actions { display: flex; justify-content: flex-end; gap: 5px; }.table-actions button { width: 27px; height: 27px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: white; }.table-actions button.delete { color: var(--danger); }
.empty-table { display: none; min-height: 300px; place-items: center; align-content: center; color: var(--muted); }.empty-table.show { display: grid; }.empty-table span { font-size: 35px; }.empty-table strong { color: var(--ink); font-size: 12px; }.empty-table small { margin-top: 4px; font-size: 8px; }

.exchange-header { max-width: 650px; margin: 10px auto 28px; text-align: center; }.exchange-header h2 { margin: 7px 0 5px; font-size: 29px; font-weight: 500; }.exchange-header p { margin: 0; color: var(--muted); font-size: 10px; }
.exchange-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; max-width: 900px; margin: auto; }.exchange-card { padding: 27px; text-align: center; }.exchange-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 15px; color: white; background: var(--forest-3); font-size: 23px; }.receiver-card .exchange-icon { color: var(--forest); background: #ddcc99; }.step-badge { display: inline-block; padding: 4px 8px; border-radius: 20px; color: var(--forest-3); background: var(--mint-pale); font-size: 7px; font-weight: 600; }.exchange-card h3 { margin: 9px 0 3px; font-size: 16px; }.exchange-card > p { min-height: 45px; margin: 0 0 16px; color: var(--muted); font-size: 9px; line-height: 1.7; }.drop-file { min-height: 83px; display: grid; place-items: center; align-content: center; border: 1px dashed #aebdb6; border-radius: 9px; color: var(--forest); background: #fafbf8; }.drop-file input { display: none; }.drop-file span { font-size: 9px; font-weight: 600; }.drop-file small { color: var(--muted); font-size: 7px; }
.storage-path { padding: 11px; border-radius: 8px; color: var(--forest); background: var(--mint-pale); font-size: 9px; font-weight: 600; word-break: break-all; }
.workflow-strip { max-width: 900px; margin: 17px auto 0; padding: 19px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 10px; }.workflow-strip > div { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }.workflow-strip > div > span { grid-row: 1 / 3; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--forest-3); font-size: 8px; }.workflow-strip strong { font-size: 8px; }.workflow-strip small { color: var(--muted); font-size: 6px; }.workflow-strip > i { color: #bfc4bf; font-style: normal; }

dialog { border: 0; padding: 0; color: var(--ink); background: var(--paper); box-shadow: 0 24px 80px rgba(14,38,32,.28); } dialog::backdrop { background: rgba(13,34,29,.58); backdrop-filter: blur(3px); }.modal { width: min(580px, calc(100% - 28px)); border-radius: 15px; }.settings-modal { width: min(1040px, calc(100% - 28px)); }.detail-modal { width: min(760px, calc(100% - 28px)); }.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 19px 22px; border-bottom: 1px solid var(--line); }.modal-header h2 { margin: 3px 0 0; font-size: 18px; }.close-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: white; font-size: 20px; }.modal-body { padding: 22px; display: grid; gap: 15px; max-height: 70vh; overflow: auto; }.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); }.login-description, .account-help { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.6; }.account-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 18px; border-top: 1px solid var(--line); }.account-heading h3 { margin: 3px 0 0; font-size: 15px; }.user-account-list { display: grid; gap: 9px; }.user-account-row { display: grid; grid-template-columns: 1fr 1.2fr 110px 1.45fr 1.2fr auto 30px; align-items: end; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fbf8fa; }.mini-field { display: grid; gap: 4px; color: var(--muted); font-size: 7px; }.mini-field input, .mini-field select { width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 7px; outline: 0; color: var(--ink); background: white; font-size: 9px; }.active-field { min-height: 34px; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 8px; }.remove-user { width: 30px; height: 34px; border: 1px solid #eccaca; border-radius: 7px; color: var(--danger); background: white; font-size: 16px; }.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }.detail-cell { padding: 10px; border-radius: 8px; background: #f7f8f4; }.detail-cell.full { grid-column: 1 / -1; }.detail-cell small, .detail-cell strong { display: block; }.detail-cell small { color: var(--muted); font-size: 7px; }.detail-cell strong { margin-top: 3px; font-size: 10px; }.detail-flowers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }.detail-flower { padding: 8px; border: 1px solid var(--line); border-radius: 7px; text-align: center; }.detail-flower small, .detail-flower strong { display: block; }.detail-flower small { color: var(--muted); font-size: 7px; }.detail-flower strong { font-size: 12px; }.detail-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }.detail-photos img { width: 100%; aspect-ratio: 4/3; border-radius: 7px; object-fit: cover; }
.confirm-modal { width: min(360px, calc(100% - 28px)); padding: 25px; border-radius: 14px; text-align: center; }.confirm-mark { width: 46px; height: 46px; display: grid; place-items: center; margin: auto; border-radius: 50%; color: var(--danger); background: #f7e5e5; font-size: 20px; font-weight: 700; }.confirm-modal h3 { margin: 10px 0 3px; }.confirm-modal p { color: var(--muted); font-size: 9px; }.confirm-modal > div:last-child { display: flex; justify-content: center; gap: 8px; margin-top: 17px; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; padding: 11px 15px; border-radius: 9px; color: white; background: #35113d; box-shadow: var(--shadow); font-size: 9px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .22s ease; }.toast.show { opacity: 1; transform: translateY(0); }
.empty-content { padding: 28px 10px; text-align: center; color: var(--muted); font-size: 9px; }.empty-content strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 11px; }
.site-footer { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 34px; padding: 22px 16px 4px; border-top: 1px solid var(--line); color: var(--muted); text-align: left; }
.footer-mark { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: var(--sand); background: var(--mint-pale); font-size: 15px; }
.site-footer span, .site-footer strong, .site-footer small { display: block; }
.site-footer span { color: var(--forest-3); font-size: 7px; font-weight: 700; letter-spacing: .12em; }
.site-footer strong { margin: 2px 0 1px; color: var(--ink); font-size: 10px; font-weight: 600; }
.site-footer small { font-size: 8px; line-height: 1.55; }

@media (max-width: 1050px) { .content { padding-inline: 24px; }.metrics-grid, .flower-total-grid { grid-template-columns: 1fr 1fr; }.entry-layout { grid-template-columns: 230px 1fr; }.flower-inputs, .photo-slot-grid { grid-template-columns: 1fr 1fr; }.user-account-row { grid-template-columns: 1fr 1fr 100px 1.4fr; }.user-account-row .mini-field:nth-of-type(5) { grid-column: span 2; } }
@media (max-width: 790px) { .app { display: block; }.sidebar { transform: translateX(-100%); transition: .22s ease; }.sidebar.open { transform: translateX(0); box-shadow: 15px 0 40px rgba(0,0,0,.2); }.content { padding: 0 14px 35px; }.menu-button { display: block; }.topbar { min-height: 84px; }.today-pill { display: none; }.topbar-actions { gap: 6px; }.topbar-actions .primary-button { width: 39px; padding: 0; font-size: 0; }.topbar-actions .primary-button span { font-size: 20px; }.hero-card { align-items: stretch; flex-direction: column; padding: 25px; }.hero-controls, .public-grand-total { min-width: 0; }.metrics-grid { grid-template-columns: 1fr 1fr; }.main-grid, .lower-grid { grid-template-columns: 1fr; }.flower-reference-note { align-items: flex-start; flex-direction: column; }.flower-reference-note div { justify-content: flex-start; }.entry-layout { grid-template-columns: 1fr; }.entry-intro { position: static; padding: 10px 4px; }.form-grid { grid-template-columns: 1fr; }.field.full { grid-column: auto; }.list-toolbar { flex-wrap: wrap; }.search-field { min-width: 100%; }.exchange-grid { grid-template-columns: 1fr; }.workflow-strip { grid-template-columns: 1fr; }.workflow-strip > i { transform: rotate(90deg); text-align: center; }.rank-row { grid-template-columns: 20px 1fr 1fr 60px; }.user-account-row { grid-template-columns: 1fr 1fr; }.user-account-row .mini-field:nth-of-type(5) { grid-column: auto; } }
@media (max-width: 520px) { .metrics-grid, .flower-total-grid { grid-template-columns: 1fr; }.flower-inputs, .photo-preview, .photo-slot-grid { grid-template-columns: 1fr 1fr; }.page-identity h1 { font-size: 18px; }.page-kicker { display: none; }.topbar-actions #authButton { max-width: 118px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }.hero-copy h2 { font-size: 25px; }.report-form { padding: 17px; }.detail-grid, .detail-flowers { grid-template-columns: 1fr 1fr; }.ranking-legend { display: none; }.rank-row { grid-template-columns: 18px 1fr 60px; }.rank-bars { display: none; }.user-account-row { grid-template-columns: 1fr; }.account-heading { align-items: flex-start; flex-direction: column; } }

@media print {
  @page { size: A4 portrait; margin: 14mm; }
  body { background: white; }
  .sidebar, .topbar, .hero-controls, .text-button, .modal-footer, .site-footer { display: none !important; }
  .content { display: block; padding: 0; }
  .page { display: none !important; }
  #dashboardPage.active { display: block !important; }
  .hero-card { min-height: auto; padding: 15px 20px; color: var(--ink); background: white; border: 1px solid #bbb; box-shadow: none; }
  .hero-copy h2 { font-size: 20px; }.hero-copy p { color: #555; }
  .metrics-grid { grid-template-columns: repeat(4, 1fr); }.metric-card, .surface { break-inside: avoid; box-shadow: none; }.metric-primary { color: var(--ink); background: white; border-color: var(--line); }.metric-primary .metric-top, .metric-primary p, .metric-primary .metric-value small { color: var(--muted); }
  .main-grid, .lower-grid { grid-template-columns: 1fr; }.coverage-panel, .latest-panel { display: none; }
  dialog[open] { position: static; width: 100%; max-width: none; box-shadow: none; }.detail-modal .modal-header, .detail-modal .modal-body { display: block; }.detail-modal::backdrop { display: none; }
}

/* บัญชีผู้ใช้แบบแบ่งระดับสิทธิ์ */
#organizationSettings { display: grid; gap: 15px; }
.settings-modal { width: min(1160px,calc(100% - 28px)); }
.settings-modal .modal-body { padding: 18px 22px; }
.organization-name-field { margin: 0; }
.district-settings { display: grid; gap: 11px; }
.district-settings-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding-top: 4px; border-top: 1px solid var(--line); }
.district-settings-heading > div:first-child { display: grid; gap: 3px; }
.district-settings-heading strong { font-size: 17px; font-weight: 500; }
.district-settings-heading small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.district-settings-heading > div:last-child { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.district-settings-heading > div:last-child > span { color: var(--plum); font-size: 14px; font-weight: 600; white-space: nowrap; }
.district-settings-heading .secondary-button { min-height: 36px; padding: 6px 11px; font-size: 13px; }
.district-settings-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 10px; }
.district-setting-row { display: grid; grid-template-columns: 28px minmax(0,1fr) 32px; align-items: center; gap: 6px; min-width: 0; padding: 5px 6px; border: 1px solid var(--line); border-radius: 7px; background: #fbf9f6; }
.district-setting-row > span { color: #8a7448; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.district-setting-row input { min-width: 0; width: 100%; padding: 7px 8px; border: 0; outline: 0; color: var(--ink); background: transparent; font: inherit; font-size: 14px; }
.district-setting-row input:focus { border-radius: 4px; background: #fff; box-shadow: inset 0 0 0 1px #b49a63; }
.district-setting-remove { width: 30px; height: 30px; border: 0; border-radius: 5px; color: #9a5260; background: transparent; font-size: 17px; cursor: pointer; }
.district-setting-remove:hover { background: #f6e9eb; }
.district-delete-modal { width: min(470px,calc(100% - 28px)); }
.district-delete-modal::backdrop { backdrop-filter: none; }
.district-delete-name { display: block; margin: 11px 0 4px; color: var(--forest); font-size: 17px; line-height: 1.45; }
.district-delete-modal > p { margin: 5px 0 0; font-size: 13px; line-height: 1.6; }
.district-usage-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.district-usage-summary > span { padding: 9px; border: 1px solid #ead9d9; border-radius: 5px; color: #7f4450; background: #fff7f7; font-size: 13px; }
.district-usage-summary strong { display: block; margin-bottom: 2px; font-size: 21px; }
@media(max-width:900px) { .district-settings-list { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:620px) { .district-settings-heading { align-items: flex-start; flex-direction: column; }.district-settings-heading > div:last-child { width: 100%; justify-content: space-between; }.district-settings-list { grid-template-columns: 1fr; } }
.user-account-row { grid-template-columns: 1fr 1.2fr 115px 1.15fr 1.35fr 1.1fr auto 74px; }
.mini-field input[readonly], .mini-field select:disabled { color: #777; background: #f1eef0; }
.own-account-note { min-height: 34px; display: grid; place-items: center; color: var(--plum); font-size: 8px; }
@media (max-width: 1050px) { .user-account-row { grid-template-columns: 1fr 1fr 100px 1fr; } }
@media (max-width: 790px) { .user-account-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .user-account-row { grid-template-columns: 1fr; } }

/* ส่วนผู้พัฒนา */
.site-footer {
  width: min(620px, 100%);
  margin-inline: auto;
  padding: 24px 22px 8px;
  justify-content: flex-start;
  gap: 17px;
}
.footer-logo {
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(69, 22, 77, .13));
}
.footer-developer { padding-left: 17px; border-left: 1px solid var(--line); }
@media (max-width: 520px) {
  .site-footer { padding-inline: 8px; gap: 12px; }
  .footer-logo { width: 62px; height: 62px; }
  .footer-developer { padding-left: 12px; }
}

/* รายละเอียดผลงานดอกไม้จันทน์รายอำเภอ */
.flower-card-copy small { font-size: 18px; }
.flower-card-copy strong { font-size: 30px; line-height: 1.3; }
.flower-card-copy em { font-size: 15px; }
.flower-card-copy b { font-size: 12px; line-height: 1.6; }
.flower-overview .section-heading h3 { font-size: 23px; }
.flower-breakdown-modal .modal-header h2 { font-size: 26px; }
.flower-breakdown-modal .section-kicker { font-size: 14px; }
.flower-breakdown-modal .secondary-button { font-size: 16px; min-height: 44px; }
button.flower-total-card {
  width: 100%;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
button.flower-total-card:hover {
  transform: translateY(-3px);
  border-color: rgba(120, 49, 118, .35);
  box-shadow: 0 14px 30px rgba(69, 22, 77, .12);
}
button.flower-total-card:focus-visible { outline: 3px solid rgba(120, 49, 118, .2); outline-offset: 3px; }
.flower-card-copy i { display: block; margin-top: 9px; color: var(--plum); font-size: 14px; font-style: normal; font-weight: 600; }
.mock-data-notice { display: flex; align-items: center; gap: 10px; margin: -5px 0 17px; padding: 10px 14px; border: 1px solid #ead9b4; border-radius: 10px; color: #765517; background: #fff9ea; }
.mock-data-notice span { flex: 0 0 auto; padding: 4px 8px; border-radius: 20px; color: white; background: #b07b20; font-size: 7px; font-weight: 700; }
.mock-data-notice p { margin: 0; font-size: 8px; }
.flower-breakdown-modal { width: min(1100px, calc(100% - 28px)); }
.modal-header-actions { display: flex; align-items: center; gap: 12px; }
.modal-header-actions > span { color: var(--muted); font-size: 15px; }
.breakdown-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.breakdown-summary > div { padding: 15px 17px; border-radius: 11px; background: linear-gradient(135deg, #f7eff7, #fbf8f5); }
.breakdown-summary span { display: block; color: var(--muted); font-size: 16px; }
.breakdown-summary strong { margin-right: 7px; color: var(--plum); font-size: 36px; }
.breakdown-summary small { color: var(--muted); font-size: 16px; }
.breakdown-scale-note { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.district-breakdown-list { display: grid; gap: 5px; }
.district-breakdown-row { display: grid; grid-template-columns: 32px minmax(0, 1.5fr) minmax(100px, 1fr) 110px; align-items: center; gap: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.district-breakdown-index { color: #856389; font-size: 15px; font-weight: 700; }
.district-breakdown-name { min-width: 0; font-size: 17px; font-weight: 500; line-height: 1.6; overflow-wrap: anywhere; }
.district-breakdown-track { display: block; width: 100%; height: 12px; overflow: hidden; border-radius: 10px; background: #eee8ef; }
.district-breakdown-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--plum), #b2577d); }
.district-breakdown-row > strong { color: var(--plum); font-size: 21px; text-align: right; font-variant-numeric: tabular-nums; }
.district-breakdown-row > strong small { color: var(--muted); font-size: 14px; font-weight: 400; }
.district-breakdown-percent { display: block; color: var(--muted); font-size: 15px; font-weight: 500; }
.breakdown-footer { align-items: center; justify-content: space-between; }
.breakdown-footer a { color: var(--muted); font-size: 13px; text-decoration: none; }
.breakdown-footer a:hover { color: var(--plum); }

/* โทนสุภาพ: ม่วงเข้ม งาช้าง และทองอ่อน */
.content { padding-bottom: 40px; }
.topbar { min-height: 116px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.page-kicker, .section-kicker { font-weight: 500; letter-spacing: .06em; }
.page-kicker { font-size: 12px; }
.page-identity h1 { font-size: 27px; font-weight: 500; }
.page-organization { margin-top: 3px; font-size: 13px; }
.today-pill span { font-size: 12px; }
.today-pill strong { font-size: 14px; }
.primary-button, .secondary-button, .danger-button, .ghost-light-button { border-radius: 5px; min-height: 44px; font-size: 14px; font-weight: 500; }
.primary-button { box-shadow: none; }
.primary-button:hover { transform: none; }
.secondary-button { background: var(--paper); }
.secondary-button:hover { border-color: var(--sand); }
.sidebar { background: #38213f; border-right: 1px solid #6c546c; }
.brand { padding-bottom: 32px; }
.brand-symbol span { background: #d7c7dc; }
.brand-symbol span:nth-child(2) { background: #c6b27e; }
.brand-symbol span:nth-child(3) { background: #a68bad; }
.brand strong { font-size: 15px; line-height: 1.6; font-weight: 500; }
.brand small { font-size: 12px; color: #d3c5d7; }
.nav-link { border-radius: 5px; font-size: 15px; }
.nav-link.active { box-shadow: inset 2px 0 #c6b27e; }
.main-nav { gap: 8px; }
.main-nav .nav-link {
  min-height: 66px;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
}
.main-nav .nav-link:hover {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.08);
}
.main-nav .nav-link.active {
  background: rgba(255,255,255,.105);
  border-color: rgba(217,199,151,.24);
  box-shadow: inset 3px 0 #d9c797;
}
.main-nav .nav-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  color: #e7d8eb;
  background: rgba(255,255,255,.045);
}
.main-nav .nav-link.active .nav-icon {
  color: #fff8e8;
  border-color: rgba(217,199,151,.42);
  background: rgba(217,199,151,.12);
}
.main-nav .nav-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-copy { display: grid; min-width: 0; gap: 2px; }
.nav-copy strong { color: #fff; font-size: 16px; font-weight: 500; line-height: 1.25; }
.nav-copy small { color: #d8ccdc; font-size: 12.5px; font-weight: 400; line-height: 1.4; }
.main-nav .nav-link.active .nav-copy small { color: #e4d6e7; }
.hero-card, .guest-mode .hero-card {
  min-height: 235px;
  padding: 38px 40px;
  border: 1px solid #60476a;
  border-top: 3px solid #b49a63;
  border-radius: 8px;
  color: #fffefa;
  background: #38213f;
  box-shadow: none;
}
.hero-tag, .guest-mode .hero-tag {
  margin-bottom: 16px;
  padding: 0;
  color: #d9c797;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 14px;
  letter-spacing: .03em;
}
.hero-copy h2, .guest-mode .hero-copy h2 { font-size: clamp(30px, 3.3vw, 43px); line-height: 1.4; font-weight: 400; }
.hero-copy h2 em, .guest-mode .hero-copy h2 em { color: #e1d3ad; }
.hero-copy p, .guest-mode .hero-copy p { margin-top: 16px; font-size: 15px; line-height: 1.7; color: #d0c3d4; }
.hero-pattern { display: none; }
.public-grand-total {
  min-width: 265px;
  padding: 12px 0 12px 32px;
  color: #fffefa;
  border: 0;
  border-left: 1px solid #78617b;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.public-grand-total > span { color: #d7c9dc; font-size: 16px; }
.public-grand-total > div { margin-top: 14px; gap: 12px; }
.public-grand-total strong { color: #f2e7cc; font-weight: 500; font-size: clamp(44px, 5vw, 64px); font-variant-numeric: tabular-nums; }
.public-grand-total small { color: #d7c9dc; font-size: 17px; }
.guest-mode .flower-overview { margin-top: 28px; }
.surface { border-radius: 8px; box-shadow: none; background: var(--paper); }
.flower-overview .section-heading { padding: 26px 26px 22px; }
.flower-overview .section-kicker { color: #887043; font-size: 13px; }
.flower-overview .section-heading h3 { margin-top: 7px; font-size: 24px; font-weight: 500; }
.flower-overview .section-note { font-size: 14px; }
.flower-total-grid { gap: 18px; padding: 0 26px 26px; }
button.flower-total-card { border-radius: 5px; border-color: #e4ded6; background: #fffefa; box-shadow: none; }
button.flower-total-card:hover { transform: none; border-color: #ad9462; box-shadow: 0 4px 16px rgba(56, 33, 63, .06); }
.flower-photo { height: 176px; background: #eeeae4; }
.flower-photo::after { display: none; }
.flower-photo > span { top: 12px; left: 12px; width: 30px; height: 30px; border-radius: 3px; background: #38213f; font-size: 12px; backdrop-filter: none; }
.flower-card-copy { padding: 20px; }
.flower-card-copy small { font-size: 19px; font-weight: 500; }
.flower-card-copy strong { margin-top: 12px; font-size: 33px; font-weight: 500; }
.flower-card-copy b { color: #807583; font-size: 12px; }
.flower-card-copy i { margin-top: 16px; padding-top: 12px; border-top: 1px solid #eee8df; color: #715778; font-size: 13px; font-weight: 400; }
.flower-reference-note { gap: 12px; padding: 16px 26px; font-size: 12px; line-height: 1.7; }
.flower-reference-note a { color: #786442; font-weight: 400; }
.mock-data-notice { margin: 18px 0; padding: 12px 16px; border-radius: 5px; border-color: #e2d6bb; background: #faf6eb; }
.mock-data-notice span { background: #85714b; border-radius: 3px; font-size: 12px; font-weight: 500; }
.mock-data-notice p { font-size: 13px; line-height: 1.7; }
.site-footer { width: min(720px, 100%); margin-top: 38px; padding-top: 28px; border-top-color: #d5c6a5; }
.footer-logo { filter: none; }
.site-footer span { color: #887043; font-size: 12px; letter-spacing: 0; font-weight: 500; }
.site-footer strong { margin: 4px 0; font-size: 17px; font-weight: 500; }
.site-footer small { font-size: 13px; line-height: 1.7; }
dialog { background: var(--paper); box-shadow: 0 24px 80px rgba(24, 14, 28, .24); }
dialog::backdrop { background: rgba(28, 21, 31, .6); backdrop-filter: blur(4px); }
.modal { border-radius: 8px; border-top: 3px solid #b49a63; }
.modal-header { padding: 22px 26px; background: #f9f7f2; }
.modal-header h2 { font-weight: 500; }
.close-button { border-radius: 5px; color: var(--forest); background: transparent; }
.breakdown-summary { gap: 18px; }
.breakdown-summary > div { padding: 20px 22px; border: 1px solid #e8e0d2; border-radius: 5px; background: #f7f4ed; }
.breakdown-summary strong { font-weight: 500; }
.district-breakdown-list { gap: 0; }
.district-breakdown-row { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding-top: 16px; padding-bottom: 16px; background: transparent; }
.district-breakdown-row:nth-child(even) { background: #faf8f4; }
.district-breakdown-index { color: #8c7548; font-weight: 500; }
.district-breakdown-track { background: #e9e3ec; height: 10px; border-radius: 2px; }
.district-breakdown-track i { background: #71547b; }
.district-breakdown-row > strong { font-weight: 500; }
.breakdown-footer { background: #f9f7f2; }
@media (max-width: 790px) {
  .topbar { min-height: 95px; margin-bottom: 18px; }
  .page-identity h1 { font-size: 21px; }
  .hero-card, .guest-mode .hero-card { padding: 28px; gap: 26px; }
  .public-grand-total { min-width: 0; width: 100%; padding: 22px 0 0; border-left: 0; border-top: 1px solid #78617b; }
  .flower-overview .section-heading { padding: 22px 18px; }
  .flower-total-grid { gap: 14px; padding: 0 18px 20px; }
  .flower-reference-note { padding: 16px 18px; }
}
@media (max-width: 520px) {
  .hero-tag, .guest-mode .hero-tag { font-size: 12px; }
  .hero-copy h2, .guest-mode .hero-copy h2 { font-size: 31px; }
  .flower-overview .section-heading h3 { font-size: 21px; }
  .flower-photo { height: 200px; }
  .mock-data-notice { align-items: flex-start; }
  .mock-data-notice span { font-size: 11px; }
  .site-footer small { font-size: 12px; }
  .breakdown-summary { gap: 10px; }
  .breakdown-summary > div { padding: 14px; }
}
/* กริดภาพมาตรฐานเดียวกันทั้งแปดชนิด */
.role-preview-banner { position: sticky; top: 0; z-index: 45; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 -12px 18px; padding: 18px 22px; color: var(--forest); background: #f4ecd8; border: 1px solid #d8c59a; border-top: 3px solid #a68a51; border-radius: 0 0 7px 7px; box-shadow: 0 4px 18px #38213f0a; }
.role-preview-banner strong, .role-preview-banner small { display: block; }
.role-preview-banner strong { font-size: 19px; font-weight: 500; margin: 4px 0; }
.role-preview-banner small { color: #72613e; font-size: 14px; line-height: 1.6; }
.preview-eyebrow { font-size: 12px; color: #7c6535; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.role-preview-modal { width: min(940px,calc(100% - 28px)); max-height: calc(100dvh - 24px); overflow: hidden; }
.role-preview-modal .modal-header { padding: 13px 18px; }
.role-preview-modal .modal-header h2 { font-size: 22px; }
.role-preview-modal .section-kicker { font-size: 11px; }
.role-preview-modal .modal-body { gap: 11px; max-height: none; padding: 14px 18px 16px; overflow: visible; }
.preview-intro { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.preview-roles { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.preview-roles button { min-width: 0; text-align: left; padding: 10px 11px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); font: inherit; }
.preview-roles button.active { border-color: var(--plum); background: #f2edf3; box-shadow: inset 3px 0 var(--plum); }
.preview-roles strong { display: block; margin-bottom: 2px; font-size: 16px; font-weight: 500; line-height: 1.3; }
.preview-roles span { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }
#rolePreviewForm { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: end; gap: 10px; padding-top: 1px; }
#rolePreviewForm .field { margin: 0; font-size: 13px; }
#rolePreviewForm select { width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: white; font: inherit; font-size: 14px; }
#rolePreviewError, .preview-form-footer { grid-column: 1 / -1; }
.preview-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.preview-form-footer > span { font-size: 13px; line-height: 1.4; color: var(--muted); }
.preview-form-footer .primary-button { min-height: 40px; padding-block: 7px; }
.role-preview-active [data-preview-locked] { opacity: .45; cursor: not-allowed; }
@media(max-width:790px) { .role-preview-banner { align-items: flex-start; flex-direction: column; gap: 12px; margin-inline: 0; padding: 15px; } .preview-actions { width: 100%; } .preview-actions button { flex: 1; font-size: 13px; } }
@media(max-width:700px) { .preview-roles { grid-template-columns: repeat(2,minmax(0,1fr)); } #rolePreviewForm { grid-template-columns: 1fr; } .role-preview-modal .modal-body { padding-inline: 14px; } }
@media(max-width:520px) { .preview-form-footer { gap: 8px; } .preview-form-footer > span { max-width: 130px; } .role-preview-modal .modal-header h2 { font-size: 20px; } }
@media(max-height:620px) { .role-preview-modal .preview-intro, .role-preview-modal .preview-roles span, .role-preview-modal .preview-form-footer > span { display: none; } .role-preview-modal .modal-body { gap: 8px; padding-block: 10px; } .preview-roles button { padding-block: 8px; } }
@media print { .role-preview-banner { display: none !important; } }
.users-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(320px,1fr); align-items: start; gap: 22px; }
.users-toolbar { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(130px,1fr); gap: 14px; }
.users-page .field { font-size: 15px; margin-bottom: 17px; }
.users-page .field input, .users-page .field select { width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); font: inherit; font-size: 16px; }
.users-page .field small { font-size: 12px; line-height: 1.7; }
.users-page .field input:focus, .users-page .field select:focus { outline: 2px solid #d9cce0; outline-offset: 1px; border-color: var(--plum); }
.users-page .field input[readonly], .users-page .field select:disabled { background: #f1efeb; color: #665f69; }
.users-page .user-editor-panel { border-top: 3px solid var(--sand); }
.users-page .user-editor-panel h3 { margin-bottom: 23px; }
.users-page .admin-table { min-width: 450px; }
.user-secondary { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.7; }
.user-role-badge { display: inline-block; padding: 3px 8px; color: var(--forest); background: #efe8f1; border-radius: 4px; font-size: 13px; }
.user-role-help { margin: -5px 0 20px; padding: 12px 14px; border-left: 2px solid var(--sand); background: #f7f3eb; font-size: 14px; color: #6d5d40; line-height: 1.8; }
.password-control { display: flex; align-items: stretch; }
.users-page .password-control input { border-radius: 5px 0 0 5px; }
.password-control button { flex: 0 0 auto; border: 1px solid var(--line); border-left: 0; border-radius: 0 5px 5px 0; background: #f4f1f5; color: var(--forest); padding: 0 12px; font: inherit; font-size: 14px; }
.user-form-error { padding: 12px 14px; color: #8e3232; background: #fff0ed; border: 1px solid #e6c4bf; border-radius: 5px; font-size: 15px; line-height: 1.7; }
.users-page #userDirectoryCount { font-size: 14px; color: var(--muted); }
@media (max-width:1100px) { .users-layout { grid-template-columns: 1fr; } .users-page .user-editor-panel { max-width: 680px; width: 100%; } }
@media (max-width:520px) { .users-toolbar { grid-template-columns: 1fr; gap: 0; } }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.admin-heading h2 { margin: 5px 0; font-size: 30px; font-weight: 500; }
.admin-heading p, .admin-panel p { color: var(--muted); font-size: 15px; line-height: 1.8; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 7px; padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.admin-tabs button { padding: 11px 16px; border: 1px solid var(--line); border-radius: 5px; color: var(--forest); background: var(--paper); font: inherit; font-size: 15px; }
.admin-tabs button.active { color: white; background: var(--forest); border-color: var(--forest); }
.admin-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.admin-stat, .admin-panel { border: 1px solid var(--line); border-radius: 7px; background: var(--paper); padding: 24px; min-width: 0; }
.admin-stat > span { color: var(--muted); font-size: 15px; }
.admin-stat > strong { display: block; margin-top: 12px; color: var(--forest); font-size: 34px; font-weight: 500; }
.admin-stat small { color: var(--muted); font-size: 14px; font-weight: 400; }
.admin-two-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.admin-panel h3 { margin: 0 0 12px; font-size: 21px; font-weight: 500; }
.admin-status { color: var(--forest) !important; font-size: 22px !important; }
.admin-button-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.admin-role-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.admin-role-row strong { font-weight: 500; }
.admin-role-row small { color: var(--muted); font-size: 13px; font-weight: 400; }
.admin-table th { font-size: 14px; white-space: nowrap; background: #f2eee6; padding: 13px; }
.admin-table td { font-size: 15px; padding: 13px; line-height: 1.7; }
.admin-table tr:nth-child(even) { background: #faf8f4; }
.admin-empty { padding: 35px 20px; text-align: center; font-size: 16px; color: var(--muted); }
.admin-districts { font-size: 16px; line-height: 2.1; padding-left: 25px; }
.admin-checkbox { display: flex; gap: 10px; align-items: center; margin: 18px 0; font-size: 16px; }
.admin-checkbox input { width: 18px; height: 18px; accent-color: var(--forest); }
#adminSystemForm .field { margin-bottom: 16px; font-size: 15px; }
#adminSystemForm input[type=date] { font-size: 16px; }
.admin-pending { color: #8a6023; }
.admin-complete { color: #326449; }
.admin-page[aria-busy=true] button { pointer-events: none; opacity: .65; }
.admin-page button:disabled { opacity: .5; cursor: default; }
.settings-modal .user-account-row { grid-template-columns: repeat(3,minmax(0,1fr)); padding: 18px; gap: 15px; }
.settings-modal .mini-field { font-size: 14px; }
.settings-modal .mini-field input, .settings-modal .mini-field select { font-size: 15px; padding: 10px; }
.settings-modal .account-help, .settings-modal .field, .settings-modal .field > small { font-size: 14px; }
.settings-modal .field input, .settings-modal .field textarea { font-size: 16px; }
.settings-modal .active-field, .settings-modal .own-account-note { font-size: 14px; }
@media(max-width:790px) {
  .admin-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-two-columns { grid-template-columns: 1fr; }
  .admin-heading { align-items: flex-start; flex-direction: column; }
  .settings-modal .user-account-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:520px) {
  .admin-panel, .admin-stat { padding: 17px; }
  .admin-tabs button { flex: 1 1 42%; font-size: 14px; padding: 10px; }
  .admin-stat > strong { font-size: 28px; }
  .settings-modal .user-account-row { grid-template-columns: 1fr; }
}

/* ข่าวภาพกิจกรรม */
.news-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 10px; padding: 0 2px; }
.news-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.news-count { padding: 6px 12px; border-radius: 999px; color: var(--forest); background: var(--mint-pale); font-size: 14px; font-weight: 600; white-space: nowrap; }
.news-toolbar { display: grid; grid-template-columns: minmax(240px,1fr) minmax(190px,.6fr) 170px 130px auto; align-items: end; gap: 12px; margin-bottom: 16px; padding: 13px 15px; }
.news-toolbar .compact-field select { min-width: 0; width: 100%; height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; font: inherit; }
.news-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 14px; }
.news-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.news-card-cover { position: relative; display: block; width: 100%; aspect-ratio: 16/9; padding: 0; overflow: hidden; border: 0; background: #ece7e8; cursor: pointer; }
.news-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.news-card:hover .news-card-cover img { transform: scale(1.025); }
.news-card-cover > span,.news-card-cover > i { position: absolute; padding: 5px 9px; border-radius: 999px; color: #fff; background: rgba(48,27,54,.78); font-size: 11px; font-style: normal; }
.news-card-cover > span { right: 10px; bottom: 10px; }.news-card-cover > i { top: 10px; left: 10px; background: rgba(142,78,98,.9); }
.news-card-body { padding: 12px 13px; }
.news-card-meta,.news-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.news-card-meta { color: var(--muted); font-size: 11px; }
.news-card-body h3 { min-height: 48px; margin: 8px 0 2px; font-size: 16px; font-weight: 600; line-height: 1.45; }
.news-card-body > .news-card-topic { min-height: 0; margin: 0 0 10px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.news-card-footer { padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10.5px; }
.news-card-footer button { padding: 0; border: 0; color: var(--forest); background: transparent; font: inherit; font-weight: 600; cursor: pointer; }
.news-pagination { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 24px; }
.news-pagination span { min-width: 100px; text-align: center; }
.news-empty { margin-top: 20px; }
.news-detail-modal { width: min(1180px,calc(100vw - 24px)); height: min(720px,calc(100dvh - 24px)); max-height: none; overflow: hidden; }
.news-detail-modal[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.news-detail-modal .modal-header { padding: 14px 18px 12px; }
.news-detail-modal .modal-header h2 { margin-top: 2px; font-size: clamp(18px,2vw,24px); line-height: 1.3; }
.news-detail-modal .modal-body { display: grid; grid-template-columns: minmax(320px,.82fr) minmax(0,1.45fr); grid-template-rows: auto minmax(0,.85fr) minmax(0,1.15fr); gap: 10px 14px; min-height: 0; max-height: none; overflow: hidden; padding: 14px 18px; }
.news-detail-modal .modal-footer { padding: 10px 18px 12px; }
.news-detail-lead { display: grid; align-content: center; gap: 3px; padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.news-detail-lead span { color: var(--forest); font-size: 13px; font-weight: 600; }.news-detail-lead strong { font-size: 17px; line-height: 1.35; }
.news-detail-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; min-height: 0; }
.news-detail-facts > div { display: grid; align-content: center; gap: 3px; min-height: 0; padding: 8px 10px; border-radius: 10px; background: #f7f3f6; }
.news-detail-facts span { color: var(--muted); font-size: 11px; line-height: 1.25; }.news-detail-facts strong { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.news-flower-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: repeat(4,minmax(0,1fr)); gap: 7px; min-height: 0; }
.news-flower-summary > div { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 5px; min-height: 0; padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; }
.news-flower-summary span { font-size: 12px; line-height: 1.2; }.news-flower-summary strong { color: var(--forest); font-size: 18px; }.news-flower-summary small { color: var(--muted); }
.news-photo-section { display: grid; grid-column: 2; grid-row: 1 / 4; grid-template-rows: auto minmax(0,1fr); min-height: 0; }
.news-photo-section > div:first-child { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }.news-photo-section h3 { margin: 0; font-size: 17px; }
.news-photo-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); grid-template-rows: repeat(2,minmax(0,1fr)); gap: 8px; min-height: 0; }
.news-photo-grid button { position: relative; min-height: 0; height: 100%; padding: 0; overflow: hidden; border: 0; border-radius: 9px; background: #eee; cursor: zoom-in; }
.news-photo-grid img { width: 100%; height: 100%; object-fit: cover; }.news-photo-grid button span { position: absolute; right: 6px; bottom: 6px; padding: 3px 6px; border-radius: 4px; color: #fff; background: rgba(36,22,40,.72); font-size: 10px; }
.news-image-modal { width: min(1100px,calc(100% - 24px)); height: min(780px,calc(100dvh - 24px)); padding: 42px 62px 18px; color: #fff; background: #1f1722; }
.news-image-modal::backdrop { background: rgba(20,13,22,.88); backdrop-filter: none; }
.news-image-modal figure { width: 100%; height: 100%; margin: 0; display: grid; grid-template-rows: minmax(0,1fr) auto; gap: 10px; text-align: center; }
.news-image-modal figure img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }.news-image-modal figcaption { font-size: 13px; }
.news-image-close { position: absolute; top: 10px; right: 12px; color: #fff; background: rgba(255,255,255,.12); }
.news-image-nav { position: absolute; top: 50%; width: 42px; height: 58px; border: 0; border-radius: 8px; color: #fff; background: rgba(255,255,255,.12); font-size: 35px; cursor: pointer; transform: translateY(-50%); }.news-image-nav.previous { left: 10px; }.news-image-nav.next { right: 10px; }
@media(max-width:1200px) { .news-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media(max-width:960px) { .news-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }.news-toolbar { grid-template-columns: 1fr 1fr; }.news-detail-modal .modal-body { grid-template-columns: minmax(270px,.9fr) minmax(0,1.25fr); padding: 12px 14px; }.news-detail-modal .modal-header,.news-detail-modal .modal-footer { padding-inline: 14px; } }
@media(max-width:720px) { .news-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:620px) { .news-heading { align-items: center; gap: 8px; }.news-heading p { font-size: 12px; }.news-count { padding: 5px 9px; font-size: 12px; }.news-toolbar { grid-template-columns: 1fr; }.news-detail-modal { width: calc(100vw - 10px); height: calc(100dvh - 10px); }.news-detail-modal .modal-body { grid-template-columns: minmax(210px,.95fr) minmax(0,1.05fr); gap: 7px; padding: 9px; }.news-detail-modal .modal-header { padding: 9px 10px 7px; }.news-detail-modal .modal-header h2 { font-size: 16px; }.news-detail-modal .modal-footer { padding: 7px 10px 9px; }.news-detail-lead strong { font-size: 14px; }.news-detail-facts { gap: 5px; }.news-detail-facts > div { padding: 5px 7px; }.news-detail-facts strong { font-size: 12px; }.news-flower-summary { gap: 4px; }.news-flower-summary > div { padding: 4px 6px; }.news-flower-summary span { font-size: 10px; }.news-flower-summary strong { font-size: 14px; }.news-photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: repeat(4,minmax(0,1fr)); gap: 5px; }.news-image-modal { padding-inline: 42px; }.news-card-body h3 { min-height: 0; } }
@media(max-width:480px) { .news-grid { grid-template-columns: 1fr; } }
.flower-total-grid { align-items: stretch; }
button.flower-total-card { display: flex; flex-direction: column; height: 100%; min-width: 0; }
.flower-photo { width: 100%; height: auto; aspect-ratio: 4 / 3; flex: 0 0 auto; overflow: hidden; border-bottom: 1px solid var(--line); }
.flower-photo > svg, .flower-photo > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.flower-card-copy { display: flex; flex-direction: column; flex: 1; width: 100%; padding: 20px; }
.flower-card-copy > small { min-height: 30px; line-height: 1.5; white-space: normal; }
.flower-card-copy > strong { display: flex; align-items: baseline; gap: 8px; min-height: 48px; margin: 9px 0 0; font-variant-numeric: tabular-nums; }
.flower-card-copy > b { min-height: 40px; margin: 7px 0 12px; line-height: 1.6; }
.flower-card-copy > i { margin-top: auto; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .hero-card, .guest-mode .hero-card { background: white; color: var(--ink); border-color: var(--line); }
  .hero-copy h2 em, .guest-mode .hero-copy h2 em, .public-grand-total strong { color: var(--forest); }
  .hero-copy p, .guest-mode .hero-copy p, .public-grand-total > span, .public-grand-total small { color: var(--muted); }
}
@media (max-width: 620px) {
  .modal-header-actions > span { display: none; }
  .district-breakdown-row { grid-template-columns: 24px minmax(0, 1fr) 90px; gap: 8px; padding: 12px; }
  .district-breakdown-track { display: block; grid-column: 2 / 4; grid-row: 2; }
  .district-breakdown-row > strong { grid-column: 3; grid-row: 1; font-size: 19px; }
  .district-breakdown-name { font-size: 16px; }
  .breakdown-summary strong { font-size: 28px; }
  .breakdown-footer { align-items: flex-end; flex-direction: column; }
}

/* หน้าจัดการบัญชี: พื้นที่ทำงานพอดีหน้าจอและรายชื่อแบบแบ่งหน้า */
.users-demo-strip { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 9px 12px; border: 1px solid #dfcea8; border-radius: 5px; background: #fbf5e8; }
.users-demo-strip > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.users-demo-strip .secondary-button { min-height: 32px; padding: 5px 9px; font-size: 12px; background: #fffefa; }
.users-demo-strip #usersDemoSummary { font-size: 13px; color: #75603a; }
.user-demo-badge { display: inline-block; padding: 2px 5px; border-radius: 3px; color: #806026; background: #f2e8d0; font-size: 10px; line-height: 1.5; }
.demo-access-modal .field, .demo-access-modal p { font-size: 15px; line-height: 1.8; }
.demo-access-modal .field input, .demo-access-modal .field select { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 5px; font: inherit; font-size: 16px; }
.users-view-tabs { display: none; }
body.users-page-active .content { height: 100dvh; display: flex; flex-direction: column; padding: 0 24px 10px; }
.users-page-active .topbar { flex: 0 0 auto; min-height: 74px; margin-bottom: 12px; }
.users-page-active #usersPage.active { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.users-page-active #usersPage > .admin-heading { flex: 0 0 auto; margin: 0 0 12px; }
.users-page-active #usersPage > .admin-heading .section-kicker { display: none; }
.users-page-active #usersPage > .admin-heading h2 { margin: 0 0 3px; font-size: 23px; }
.users-page-active #usersPage > .admin-heading p { margin: 0; font-size: 13px; line-height: 1.6; }
.users-page-active .users-layout { flex: 1 1 auto; min-height: 0; grid-template-columns: minmax(0,1.08fr) minmax(0,1fr); gap: 16px; align-items: stretch; }
.users-page-active .users-layout > .admin-panel { padding: 16px; min-height: 0; }
.users-page-active .users-directory { display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; }
.users-page-active .users-toolbar { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 10px; }
.users-page-active .users-page .field { font-size: 13px; gap: 4px; margin: 0; }
.users-page-active .users-page .field input, .users-page-active .users-page .field select { padding: 8px 10px; font-size: 14px; height: 38px; }
.users-page-active .users-page .field small { font-size: 11px; line-height: 1.5; }
.users-page-active #userDirectoryCount { font-size: 12px; margin: 8px 0; }
.users-page-active #userDirectory { min-height: 0; }
.users-page-active #userDirectory .table-wrap { overflow: visible; }
.users-page-active #userDirectory table { min-width: 0; table-layout: fixed; }
.users-page-active #userDirectory th { font-size: 12px; padding: 9px 6px; }
.users-page-active #userDirectory td { padding: 8px 6px; min-height: 68px; font-size: 13px; vertical-align: middle; }
.users-page-active #userDirectory th:nth-child(1) { width: 34%; }
.users-page-active #userDirectory th:nth-child(2) { width: 31%; }
.users-page-active #userDirectory th:nth-child(3) { width: 17%; }
.users-page-active #userDirectory th:nth-child(4) { width: 18%; }
.users-page-active #userDirectory td strong, .users-page-active #userDirectory .user-secondary { display: block; max-width: 100%; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.users-page-active #userDirectory td strong { line-height: 1.45; }
.users-page-active #userDirectory .user-secondary { margin-top: 3px; font-size: 11px; }
.users-page-active #userDirectory .user-role-badge { padding: 2px 6px; font-size: 11px; white-space: nowrap; }
.users-page-active #userDirectory .secondary-button { min-height: 32px; padding: 5px 8px; font-size: 12px; }
.users-pagination { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.users-pagination span { font-size: 13px; color: var(--muted); }
.users-pagination .secondary-button { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.users-pagination button:disabled { opacity: .4; cursor: default; }
.users-page-active .users-page .user-editor-panel { max-width: none; }
.users-page-active .users-page .user-editor-panel h3 { margin: 0 0 12px; font-size: 20px; }
.users-page-active #userEditor { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; align-items: start; }
.users-page-active #userEditor > * { min-width: 0; }
.users-page-active #userEditor .user-role-help { margin: 0; padding: 9px 10px; font-size: 12px; line-height: 1.6; }
.users-page-active #userEditor .admin-checkbox { margin: 0; min-height: 38px; font-size: 13px; }
.users-page-active #userEditor .admin-button-row { margin: 0; gap: 7px; justify-content: flex-end; }
.users-page-active #userEditor .admin-button-row button { min-height: 38px; padding: 8px 10px; font-size: 13px; }
.users-page-active #userFormError { grid-column: 1 / -1; margin: 0; padding: 7px 10px; font-size: 13px; }
.users-page-active .password-control button { padding: 0 8px; font-size: 12px; }
.users-page-active .site-footer { flex: 0 0 auto; margin-top: 12px; padding: 9px 0 0; gap: 10px; }
.users-page-active .footer-logo { width: 38px; height: 38px; }
.users-page-active .footer-developer { padding-left: 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 9px; }
.users-page-active .site-footer span { font-size: 10px; }
.users-page-active .site-footer strong { font-size: 13px; margin: 0; }
.users-page-active .site-footer small { font-size: 11px; line-height: 1.5; }
.users-page-active .role-preview-banner { flex: 0 0 auto; padding: 8px 12px; margin: 0 0 8px; gap: 10px; }
.users-page-active .role-preview-banner strong { font-size: 15px; margin: 0; }
.users-page-active .role-preview-banner small, .users-page-active .preview-eyebrow { font-size: 11px; }
.users-page-active .preview-actions button { font-size: 12px; padding: 6px 9px; min-height: 34px; }
@media(max-width:1100px) {
  .users-page-active .users-layout { grid-template-columns: minmax(0,1fr); }
  .users-page-active .users-view-tabs { display: flex; flex: 0 0 auto; gap: 8px; margin-bottom: 12px; }
  .users-view-tabs button { flex: 1; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 5px; font: inherit; font-size: 14px; color: var(--forest); background: var(--paper); }
  .users-view-tabs button.active { color: white; border-color: var(--forest); background: var(--forest); }
  .users-page-active #usersPage[data-users-view=directory] .user-editor-panel, .users-page-active #usersPage[data-users-view=editor] .users-directory { display: none; }
  .users-page-active #userEditor { gap: 14px 20px; }
  .users-page-active .admin-heading { flex-direction: row; align-items: center; }
  .users-page-active .role-preview-banner { flex-direction: row; }
  .users-page-active .preview-actions { width: auto; }
}
@media(max-width:520px) {
  body.users-page-active .content { padding-inline: 12px; }
  .users-page-active .topbar { min-height: 64px; gap: 8px; }
  .users-page-active .page-identity h1 { font-size: 19px; }
  .users-page-active #usersPage > .admin-heading h2 { font-size: 19px; }
  .users-page-active #usersPage > .admin-heading p { display: none; }
  .users-page-active #usersPage > .admin-heading button { min-height: 36px; padding: 7px 10px; font-size: 13px; }
  .users-page-active .users-layout > .admin-panel { padding: 12px; }
  .users-page-active #userEditor { gap: 10px; }
  .users-page-active #userEditor > .field:first-child small { display: none; }
  .users-page-active .site-footer { margin-top: 8px; }
  .users-page-active .site-footer small:last-child { flex-basis: 100%; font-size: 10px; }
}
@media(max-height:800px) {
  .users-page-active #userEditor > .field:first-child small { display: none; }
  .users-page-active #userEditor { gap: 10px; }
}
@media(max-height:700px) {
  .users-page-active .topbar { min-height: 60px; margin-bottom: 8px; }
  .users-page-active #usersPage > .admin-heading p, .users-page-active .site-footer { display: none; }
  .users-page-active #userEditor .user-role-help, .users-page-active #userEditor .field small { display: none; }
  .users-page-active #userEditor { gap: 8px 12px; }
  .users-page-active .users-page .field input, .users-page-active .users-page .field select { height: 34px; padding-block: 6px; }
  .users-page-active .users-demo-strip { margin-bottom: 8px; padding: 6px 10px; }
}
@media(max-width:640px) { .users-demo-strip { align-items: flex-start; flex-direction: column; gap: 5px; } }

/* หน้าบันทึกรายวัน: เห็นข้อมูลครบในพื้นที่ทำงานเดียว */
.entry-page-active .entry-layout { max-width: 1440px; margin: 0 auto; }
.entry-page-active .entry-intro { position: static; display: grid; grid-template-columns: minmax(260px,auto) minmax(260px,1fr) minmax(280px,auto); align-items: center; gap: 18px; padding: 0; }
.entry-page-active .entry-heading { display: flex; align-items: center; gap: 12px; }
.entry-page-active .entry-number { flex: 0 0 auto; display: grid; width: 40px; height: 40px; place-items: center; color: #fff8e8; border-radius: 5px; background: var(--forest); font-size: 16px; font-weight: 500; }
.entry-page-active .entry-intro .section-kicker { color: #8a7445; font-size: 11px; }
.entry-page-active .entry-intro h2 { margin: 2px 0 0; font-size: 23px; line-height: 1.35; }
.entry-page-active .entry-intro > p { margin: 0; font-size: 13px; line-height: 1.6; }
.entry-page-active .entry-tip { align-items: center; margin: 0; padding: 9px 11px; border: 1px solid #e5d8ba; border-radius: 5px; background: #faf6eb; }
.entry-page-active .entry-tip p { color: #705f3d; font-size: 11.5px; line-height: 1.5; }
.entry-page-active .report-form { border-top: 3px solid var(--sand); }
.entry-page-active .form-section-title { margin: 0; color: var(--forest); font-size: 15px; }
.entry-page-active .form-section-title:not(:first-of-type) { margin-top: 0; }
.entry-page-active .form-section-title span { white-space: nowrap; }
.entry-page-active .form-section-title span > b { display: inline-grid; width: 24px; height: 24px; margin-right: 5px; place-items: center; color: #fff; border-radius: 4px; background: var(--forest); font-size: 12px; font-weight: 500; }
.entry-page-active .field { gap: 4px; font-size: 13px; }
.entry-page-active .field input, .entry-page-active .field textarea { height: 40px; padding: 8px 10px; border-radius: 5px; font-size: 14px; }
.entry-page-active .field > small { font-size: 11px; line-height: 1.4; }
.entry-page-active .suffix-input { border-radius: 5px; }
.entry-page-active .suffix-input span { font-size: 12px; }
.entry-page-active .flower-field { padding: 8px; border-radius: 5px; }
.entry-page-active .flower-field > span { margin-bottom: 5px; font-size: 12.5px; line-height: 1.35; }
.entry-page-active .flower-field .suffix-input input { height: 34px; padding: 6px 8px; font-size: 13px; }
.entry-page-active .flower-field .suffix-input span { padding-inline: 7px; font-size: 10px; }
.entry-page-active .form-total { margin: 0; padding: 9px 11px; border-radius: 5px; font-size: 12px; }
.entry-page-active .form-total strong { font-size: 17px; }
.entry-page-active .photo-help { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.entry-page-active .photo-slot-grid { gap: 7px; }
.entry-page-active .photo-slot { border-radius: 5px; }
.entry-page-active .photo-slot .slot-number { width: 24px; height: 24px; font-size: 11px; }
.entry-page-active .photo-slot strong { font-size: 11px; }
.entry-page-active .photo-slot small { font-size: 9px; }
.entry-page-active .photo-slot .slot-label { font-size: 10px; }
.entry-page-active .form-actions { margin: 0; padding-top: 10px; }
.entry-page-active .form-actions button { min-height: 40px; }

@media(min-width:1260px) {
  body.entry-page-active { overflow: hidden; }
  body.entry-page-active .content { height: 100dvh; display: flex; flex-direction: column; padding: 0 24px 10px; overflow: hidden; }
  .entry-page-active .topbar { flex: 0 0 auto; min-height: 72px; margin-bottom: 10px; }
  .entry-page-active #entryPage.active { display: flex; flex: 1 1 auto; min-height: 0; }
  .entry-page-active .entry-layout { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; width: 100%; gap: 10px; }
  .entry-page-active .entry-intro { flex: 0 0 auto; }
  .entry-page-active .report-form { display: grid; flex: 1 1 auto; min-height: 0; grid-template-columns: minmax(355px,1.15fr) minmax(255px,.8fr) minmax(330px,1fr); grid-template-rows: auto auto minmax(0,1fr) auto auto; align-items: start; gap: 10px 16px; padding: 14px 16px; }
  .entry-page-active .activity-title { grid-column: 1; grid-row: 1; }
  .entry-page-active .activity-fields { grid-column: 1; grid-row: 2 / 5; }
  .entry-page-active .flowers-title { grid-column: 2; grid-row: 1; }
  .entry-page-active .flower-inputs { grid-column: 2; grid-row: 2 / 4; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; gap: 7px; }
  .entry-page-active .form-total { grid-column: 2; grid-row: 4; }
  .entry-page-active .photos-title { grid-column: 3; grid-row: 1; }
  .entry-page-active .photo-help { grid-column: 3; grid-row: 2; }
  .entry-page-active .photo-slot-grid { grid-column: 3; grid-row: 3 / 5; grid-template-columns: repeat(4,minmax(0,1fr)); align-content: start; }
  .entry-page-active .form-actions { grid-column: 1 / -1; grid-row: 5; }
  .entry-page-active .site-footer { display: none; }
}
@media(max-width:1259px) {
  .entry-page-active .entry-intro { grid-template-columns: 1fr; gap: 8px; }
  .entry-page-active .entry-tip { max-width: none; }
  .entry-page-active .report-form { padding: 18px; }
  .entry-page-active .form-section-title { margin: 18px 0 12px; }
  .entry-page-active .form-section-title:first-of-type { margin-top: 0; }
}
@media(min-width:1260px) and (max-height:760px) {
  .entry-page-active .topbar { min-height: 60px; margin-bottom: 7px; }
  .entry-page-active .entry-intro { grid-template-columns: minmax(260px,auto) 1fr; }
  .entry-page-active .entry-tip { display: none; }
  .entry-page-active .report-form { gap-block: 7px; padding-block: 10px; }
  .entry-page-active .field input, .entry-page-active .field textarea { height: 36px; padding-block: 6px; }
  .entry-page-active .activity-fields { gap-block: 8px; }
}
@media(max-width:520px) {
  .entry-page-active .entry-intro > p { font-size: 12px; }
  .entry-page-active .entry-tip { display: none; }
  .entry-page-active .entry-intro h2 { font-size: 20px; }
  .entry-page-active .report-form { padding: 13px; }
}

/* แบบฟอร์มสามแท็บในหน้าเดียว */
.entry-page-active .report-form { display: flex; flex-direction: column; gap: 0; }
.entry-tabs { display: grid; flex: 0 0 auto; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.entry-tabs button { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 58px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #fff; font: inherit; text-align: left; }
.entry-tabs button:hover { border-color: #c9b991; background: #fcfaf5; }
.entry-tabs button.active { color: var(--forest); border-color: var(--plum); background: #f3edf4; box-shadow: inset 3px 0 var(--plum); }
.entry-tabs button.complete:not(.active) { border-color: #cabd9d; background: #fbf8ef; }
.entry-tabs button > span:last-child { min-width: 0; }
.entry-tabs strong, .entry-tabs small { display: block; }
.entry-tabs strong { color: var(--forest); font-size: 15px; font-weight: 500; line-height: 1.35; }
.entry-tabs small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 11.5px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.entry-tab-status { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; color: #fff; border-radius: 50%; background: #8a778f; font-size: 13px; font-weight: 600; }
.entry-tabs button.active .entry-tab-status { background: var(--forest); }
.entry-tabs button.complete .entry-tab-status { background: #85703f; }
.entry-tab-panels { flex: 1 1 auto; min-height: 0; }
.entry-tab-panel { height: 100%; padding: 14px 3px 8px; }
.entry-tab-panel[hidden] { display: none !important; }
.entry-tab-panel .form-section-title { margin-bottom: 13px; }
.entry-tab-panel .activity-fields { width: min(940px,100%); grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px 16px; }
.entry-tab-panel .flower-inputs { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.entry-tab-panel .form-total { margin-top: 12px; }
.entry-tab-panel .photo-help { margin: -5px 0 10px; }
.entry-tab-panel .photo-slot-grid { grid-template-columns: repeat(4,minmax(0,1fr)); width: min(920px,100%); }
.entry-page-active .form-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; }
.entry-step-actions { display: flex; align-items: center; gap: 8px; }
.entry-step-actions button { min-width: 112px; }

@media(min-width:1260px) {
  .entry-page-active .report-form { display: flex; padding: 14px 16px; }
  .entry-page-active .entry-tab-panel .activity-fields { grid-column: auto; grid-row: auto; }
  .entry-page-active .entry-tab-panel .flower-inputs { grid-column: auto; grid-row: auto; }
  .entry-page-active .entry-tab-panel .form-total { grid-column: auto; grid-row: auto; }
  .entry-page-active .entry-tab-panel .photo-help { grid-column: auto; grid-row: auto; }
  .entry-page-active .entry-tab-panel .photo-slot-grid { grid-column: auto; grid-row: auto; }
}
@media(max-width:790px) {
  .entry-tabs { gap: 5px; }
  .entry-tabs button { justify-content: center; min-height: 48px; padding: 7px; }
  .entry-tabs button > span:last-child { display: none; }
  .entry-tab-status { width: 28px; height: 28px; flex-basis: 28px; }
  .entry-tab-panel .activity-fields { grid-template-columns: 1fr; }
  .entry-tab-panel .field.full { grid-column: auto; }
  .entry-tab-panel .flower-inputs, .entry-tab-panel .photo-slot-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .entry-page-active .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .entry-step-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .entry-step-actions button:only-child, #saveReportButton:not([hidden]) { grid-column: 1 / -1; }
  .entry-step-actions button { min-width: 0; }
}

/* ขยายพื้นที่แท็บให้พอดีกับหน้าจอ */
.entry-page-active .entry-layout { width: 100%; max-width: none; }
.entry-page-active .report-form { width: 100%; }
.entry-tab-panel.active { min-height: 0; }
@media(min-width:1260px) {
  .entry-page-active .entry-tab-panels { display: flex; min-height: 0; }
  .entry-page-active .entry-tab-panel.active { display: grid; flex: 1 1 auto; width: 100%; }
  .entry-page-active .entry-tab-panel[data-entry-panel="activity"] { grid-template-rows: auto minmax(0,1fr); }
  .entry-page-active .entry-tab-panel[data-entry-panel="activity"] .activity-fields { width: 100%; grid-template-columns: repeat(3,minmax(0,1fr)); align-content: center; gap: 20px; }
  .entry-page-active .activity-fields .field.full { grid-column: auto; }
  .entry-page-active .entry-tab-panel[data-entry-panel="flowers"] { grid-template-rows: auto minmax(0,1fr) auto; }
  .entry-page-active .entry-tab-panel[data-entry-panel="flowers"] .flower-inputs { width: 100%; grid-template-columns: repeat(8,minmax(0,1fr)); align-content: center; gap: 10px; }
  .entry-page-active .entry-tab-panel[data-entry-panel="photos"] { grid-template-rows: auto auto minmax(0,1fr); }
  .entry-page-active .entry-tab-panel[data-entry-panel="photos"] .photo-slot-grid { width: 100%; grid-template-columns: repeat(8,minmax(0,1fr)); align-content: center; gap: 9px; }
  .entry-page-active .entry-tab-panel[data-entry-panel="photos"] .photo-slot { width: 100%; }
  .entry-page-active .form-actions { width: 100%; }
}
@media(min-width:1260px) and (max-height:720px) {
  .entry-page-active .entry-intro > p { display: none; }
  .entry-page-active .entry-intro { grid-template-columns: 1fr auto; }
  .entry-page-active .entry-tabs button { min-height: 50px; }
  .entry-page-active .entry-tab-panel { padding-block: 10px 5px; }
}

/* ปรับสมดุลหน้าบันทึกข้อมูล */
@media(min-width:1260px) {
  .entry-page-active .report-form { align-items: stretch; }
  .entry-page-active .entry-tabs { width: 100%; }
  .entry-page-active .entry-tabs button { justify-content: flex-start; min-height: 64px; padding: 10px 16px; }
  .entry-page-active .entry-tab-panels { width: 100%; }
  .entry-page-active .entry-tab-panel.active { width: 100%; padding: 16px 8px 8px; }
  .entry-page-active .entry-tab-panel .activity-title,
  .entry-page-active .entry-tab-panel .flowers-title,
  .entry-page-active .entry-tab-panel .photos-title,
  .entry-page-active .entry-tab-panel .activity-fields,
  .entry-page-active .entry-tab-panel .flower-inputs,
  .entry-page-active .entry-tab-panel .form-total,
  .entry-page-active .entry-tab-panel .photo-help,
  .entry-page-active .entry-tab-panel .photo-slot-grid { grid-column: auto; grid-row: auto; }
  .entry-page-active .entry-tab-panel[data-entry-panel="activity"] { grid-template-rows: auto minmax(0,1fr); }
  .entry-page-active .entry-tab-panel[data-entry-panel="activity"] .activity-fields { width: min(1120px,100%); margin: auto; grid-template-columns: repeat(3,minmax(0,1fr)); align-content: center; gap: 22px 18px; }
  .entry-page-active .entry-tab-panel[data-entry-panel="flowers"] { grid-template-rows: auto minmax(0,1fr) auto; }
  .entry-page-active .entry-tab-panel[data-entry-panel="flowers"] .flower-inputs { width: min(1120px,100%); margin: auto; grid-template-columns: repeat(4,minmax(0,1fr)); align-content: center; gap: 14px; }
  .entry-page-active .entry-tab-panel[data-entry-panel="flowers"] .form-total { width: min(1120px,100%); margin: 10px auto 0; }
  .entry-page-active .entry-tab-panel[data-entry-panel="photos"] { grid-template-rows: auto auto minmax(0,1fr); }
  .entry-page-active .entry-tab-panel[data-entry-panel="photos"] .photo-help { width: min(1120px,100%); margin: 0 auto; }
  .entry-page-active .entry-tab-panel[data-entry-panel="photos"] .photo-slot-grid { width: min(1120px,100%); margin: auto; grid-template-columns: repeat(4,minmax(0,1fr)); align-content: center; gap: 12px; }
  .entry-page-active .entry-tab-panel[data-entry-panel="photos"] .photo-slot { max-height: 165px; aspect-ratio: 16 / 9; }
}
@media(min-width:1260px) and (max-height:760px) {
  .entry-page-active .entry-tabs button { min-height: 54px; padding-block: 7px; }
  .entry-page-active .entry-tab-panel[data-entry-panel="flowers"] .flower-inputs { gap: 9px; }
  .entry-page-active .entry-tab-panel[data-entry-panel="photos"] .photo-slot { max-height: 125px; }
}

/* ลวดลายและสีเน้นแบบสุภาพ */
body {
  background:
    radial-gradient(circle at 9% 5%, rgba(112,81,122,.075) 0, rgba(112,81,122,0) 28%),
    radial-gradient(circle at 92% 92%, rgba(180,154,99,.09) 0, rgba(180,154,99,0) 30%),
    var(--canvas);
}
.sidebar {
  overflow: hidden;
  background:
    radial-gradient(circle at 105% 3%, rgba(217,199,151,.16) 0 12%, transparent 34%),
    radial-gradient(circle at -15% 78%, rgba(185,99,147,.13) 0 10%, transparent 34%),
    linear-gradient(180deg,#38213f 0%,#45264d 55%,#38213f 100%);
}
.sidebar::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background: repeating-linear-gradient(135deg,transparent 0 17px,rgba(255,255,255,.055) 17px 18px,transparent 18px 35px);
}
.sidebar > * { position: relative; z-index: 1; }
.topbar { position: relative; }
.topbar::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg,#b49a63 0 90px,var(--line) 90px 100%);
}
.page-identity { position: relative; padding-left: 14px; }
.page-identity::before { content: ''; position: absolute; inset: 4px auto 3px 0; width: 3px; border-radius: 3px; background: linear-gradient(#b49a63,#76537f); }
.hero-card, .guest-mode .hero-card { isolation: isolate; }
.hero-card::before {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg,rgba(180,154,99,.12),transparent 34%,rgba(185,99,147,.08));
}
.hero-pattern {
  display: block;
  z-index: 0;
  right: 0;
  top: 50%;
  width: auto;
  height: calc(100% - 12px);
  aspect-ratio: 1;
  opacity: .24;
  border: 0;
  border-radius: 0;
  transform: translate(33.333%,-50%);
  background: none;
  pointer-events: none;
}
.hero-pattern::before, .hero-pattern::after { content: none; }
.hero-pattern svg { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke: #e6d5a4; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.hero-pattern .memorial-flower-inner { opacity: .72; stroke-width: 1; }
.hero-pattern .memorial-flower-stem { opacity: .78; stroke-width: 1.6; }
.hero-pattern .memorial-flower-leaf { fill: rgba(230,213,164,.06); opacity: .8; }
.guest-mode .hero-pattern { opacity: .13; }
.metrics-grid .metric-card { position: relative; overflow: hidden; background-image: linear-gradient(135deg,rgba(112,81,122,.035),transparent 55%); }
.metrics-grid .metric-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: #84628d; }
.metrics-grid .metric-card:nth-child(1)::before { background: #b49a63; }
.metrics-grid .metric-card:nth-child(2)::before { background: #806494; }
.metrics-grid .metric-card:nth-child(3)::before { background: #c19a4b; }
.metrics-grid .metric-card:nth-child(4)::before { background: #ad617f; }
#dashboardPage .surface { border-color: #e1d8cb; }
#dashboardPage .section-heading { position: relative; }
#dashboardPage .section-heading::after { content: ''; position: absolute; bottom: 0; left: 20px; width: 42px; height: 2px; background: linear-gradient(90deg,#b49a63,transparent); }
.flower-overview { position: relative; overflow: hidden; }
.flower-overview::before { content: ''; position: absolute; z-index: 1; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg,#60476a 0 34%,#b49a63 34% 67%,#a65e7b 67%); }
button.flower-total-card { border-top-width: 3px; }
button.flower-total-card:nth-child(4n+1) { border-top-color: #75557e; }
button.flower-total-card:nth-child(4n+2) { border-top-color: #b49a63; }
button.flower-total-card:nth-child(4n+3) { border-top-color: #9a698b; }
button.flower-total-card:nth-child(4n+4) { border-top-color: #b26a82; }
.ranking-panel, .coverage-panel, .trend-panel { background-image: linear-gradient(150deg,rgba(180,154,99,.035),transparent 42%); }
.site-footer { position: relative; }
.site-footer::before { content: '✦'; position: absolute; top: -11px; left: 50%; padding: 0 10px; color: #a68a51; background: var(--canvas); transform: translateX(-50%); font-size: 12px; }
@media(max-width:790px) {
  .hero-pattern { right: 0; width: auto; height: calc(100% - 10px); }
  #dashboardPage .section-heading::after { display: none; }
}
@media print {
  body, .metrics-grid .metric-card, .ranking-panel, .coverage-panel, .trend-panel { background: white !important; }
  .hero-pattern, .hero-card::before, .sidebar::after, .site-footer::before { display: none !important; }
}

/* การ์ดรายละเอียดและกราฟแนวโน้มการผลิต */
button.metric-card { width: 100%; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
button.metric-card.metric-primary { color: #fff; }
button.metric-card:hover { border-color: #b49a63; transform: translateY(-2px); box-shadow: 0 9px 24px rgba(56,33,63,.09); }
button.metric-card:focus-visible { outline: 3px solid rgba(180,154,99,.38); outline-offset: 2px; }
.metric-open { display: block; margin-top: 11px; color: #715778; font-size: 11px; font-weight: 500; }
.metric-primary .metric-open { color: #eadcae; }
.trend-heading-controls { display: flex; align-items: flex-end; flex-direction: column; gap: 7px; }
.trend-switch { display: grid; grid-template-columns: repeat(3,1fr); padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: #f2edf3; }
.trend-switch button { min-width: 78px; padding: 6px 9px; border: 0; border-radius: 3px; color: var(--muted); background: transparent; font: inherit; font-size: 12px; }
.trend-switch button.active { color: #fff; background: var(--forest); }
.trend-panel .chart-wrap { height: 245px; padding-top: 16px; }
.trend-panel .y-axis { min-width: 48px; font-size: 10px; font-variant-numeric: tabular-nums; }
.trend-panel .bar-chart { gap: 8px; }
.trend-panel .bar-item { position: relative; min-width: 22px; }
.trend-panel .bar-value { width: min(28px,72%); background: linear-gradient(180deg,#b49a63,#6f4d79); }
.trend-panel .bar-number { min-height: 15px; color: #6d5a71; font-size: 9px; font-weight: 500; font-variant-numeric: tabular-nums; }
.trend-panel .bar-label { height: 15px; font-size: 9px; white-space: nowrap; }
.metric-detail-modal { width: min(1000px,calc(100% - 28px)); }
.metric-detail-modal .modal-body { gap: 14px; max-height: 72vh; }
.metric-detail-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 14px 17px; border: 1px solid #dfd2b5; border-radius: 5px; background: #faf6eb; }
.metric-detail-summary span { color: #75623d; font-size: 14px; }
.metric-detail-summary strong { color: var(--forest); font-size: 27px; font-weight: 500; }
.metric-detail-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 5px; }
.metric-detail-table { min-width: 680px; }
.metric-detail-table th { position: sticky; top: 0; z-index: 1; padding: 10px 12px; font-size: 12px; background: #f2edf3; }
.metric-detail-table td { padding: 10px 12px; font-size: 13px; }
.metric-detail-table td.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.metric-status { display: inline-block; padding: 3px 7px; border-radius: 3px; color: #705f3d; background: #f4ead4; font-size: 11px; }
.metric-status.pending { color: #7a6f7d; background: #eee9ef; }
.metric-report-open { min-height: 30px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--forest); background: #fff; font: inherit; font-size: 12px; }
@media(max-width:790px) {
  .trend-panel .section-heading { align-items: flex-start; flex-direction: column; }
  .trend-heading-controls { width: 100%; align-items: stretch; }
  .trend-switch button { min-width: 0; }
  .trend-panel .chart-wrap { overflow-x: auto; }
  .trend-panel .bar-chart { min-width: 620px; }
  .metric-detail-summary { align-items: flex-start; flex-direction: column; }
}

/* การ์ดสรุปภาพรวมแบบกระชับ */
.metrics-grid { gap: 12px; margin: 14px 0 17px; }
button.metric-card {
  display: flex;
  min-height: 142px;
  padding: 14px 16px 13px;
  flex-direction: column;
  border-radius: 10px;
}
.metric-top { min-height: 30px; font-size: 11px; font-weight: 500; }
.metric-icon { width: 30px; height: 30px; border-radius: 7px; font-size: 14px; }
.metric-value { display: flex; align-items: flex-end; margin-top: 3px; }
.metric-value strong {
  font-size: clamp(38px,3vw,46px);
  line-height: .95;
  font-weight: 600;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.metric-value small { margin: 0 0 3px 8px; font-size: 11px; }
.metric-card p {
  min-height: 15px;
  margin: 7px 0 0;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.45;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.metric-progress { height: 3px; margin-top: 8px; }
.metric-open {
  width: 100%;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(112,81,122,.12);
  font-size: 10px;
  line-height: 1;
}
.metric-primary .metric-open { border-top-color: rgba(255,255,255,.14); }
@media(max-width:1050px) {
  .metric-value strong { font-size: 40px; }
}
@media(max-width:520px) {
  button.metric-card { min-height: 132px; }
  .metric-value strong { font-size: 42px; }
  .page-organization { max-width: 230px; font-size: 10px; line-height: 1.35; }
}

/* การ์ดดอกไม้จันทน์แบบหัวการ์ดและสัดส่วนกระชับ */
button.flower-total-card { border-top-width: 1px; }
.flower-card-header {
  display: flex;
  min-height: 48px;
  padding: 10px 13px;
  align-items: center;
  gap: 10px;
  border-top: 3px solid #75557e;
  border-bottom: 1px solid var(--line);
  background: #fbf8f4;
}
button.flower-total-card:nth-child(4n+2) .flower-card-header { border-top-color: #b49a63; }
button.flower-total-card:nth-child(4n+3) .flower-card-header { border-top-color: #9a698b; }
button.flower-total-card:nth-child(4n+4) .flower-card-header { border-top-color: #b26a82; }
.flower-card-header > span {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 4px;
  color: #fff;
  background: var(--forest);
  font-size: 11px;
  font-weight: 600;
}
.flower-card-header > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.flower-total-card .flower-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line);
}
.flower-total-card .flower-card-copy {
  display: flex;
  min-height: 72px;
  padding: 12px 13px;
  align-items: flex-end;
  justify-content: space-between;
  flex-direction: row;
  gap: 10px;
}
.flower-total-card .flower-card-copy > strong {
  display: flex;
  min-height: 0;
  margin: 0;
  align-items: baseline;
  gap: 6px;
  color: var(--forest);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.flower-total-card .flower-card-copy > strong em { color: var(--muted); font-size: 12px; }
.flower-total-card .flower-card-copy > i {
  margin: 0;
  padding: 0 0 2px;
  border: 0;
  color: #715778;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
  white-space: nowrap;
}
@media(max-width:520px) {
  .flower-card-header { min-height: 46px; }
  .flower-card-header > strong { font-size: 17px; }
  .flower-total-card .flower-card-copy { min-height: 68px; }
  .flower-total-card .flower-card-copy > strong { font-size: 32px; }
}
