:root {
    --modern-teal: #17b8aa;
    --modern-teal-dark: #098f86;
    --modern-coral: #ff5b65;
    --modern-blue: #338dea;
    --modern-amber: #ffa713;
    --modern-ink: #17201d;
    --modern-muted: #717b77;
    --modern-line: #e7ebe9;
    --modern-surface: #ffffff;
    --modern-bg: #f6f8f7;
}

/* 목장 현황 - 후대 도축성적 우수 암소 */
.dam-ranking { margin-bottom: 15px; padding: 22px; border-color: #d9e5df; }
.dam-analysis-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 22px; padding: 6px; border-radius: 15px; background: #edf2ef; }
.dam-analysis-tabs button { min-height: 55px; padding: 10px 16px; border: 0; border-radius: 11px; background: transparent; color: #596860; font: inherit; font-size: 18px; font-weight: 950; word-break: keep-all; cursor: pointer; }
.dam-analysis-tabs button.active { background: #fff; color: #087f75; box-shadow: 0 4px 12px rgba(29, 62, 51, .11); }
.dam-analysis-panel[hidden] { display: none !important; }
.dam-ranking-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dam-ranking-header .panel-kicker { font-size: 14px; }
.dam-ranking-header h2 { margin: 4px 0 7px; color: #203b30; font-size: 31px; letter-spacing: -.035em; }
.dam-ranking-header p { max-width: 720px; margin: 0; color: #5f6e67; font-size: 15px; line-height: 1.55; word-break: keep-all; }
.dam-rank-controls { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.dam-rank-scope { display: flex; gap: 3px; padding: 4px; border-radius: 12px; background: #edf2ef; }
.dam-rank-scope button { min-height: 41px; padding: 7px 13px; border: 0; border-radius: 9px; background: transparent; color: #66736d; font: inherit; font-size: 14px; font-weight: 900; white-space: nowrap; cursor: pointer; }
.dam-rank-scope button.active { background: #fff; color: #087f75; box-shadow: 0 3px 9px rgba(29, 62, 51, .1); }
.dam-rank-method { position: relative; }
.dam-rank-method summary { min-height: 49px; padding: 13px 15px; border: 1px solid #d9e3df; border-radius: 11px; color: #506159; font-size: 14px; font-weight: 900; list-style: none; white-space: nowrap; cursor: pointer; }
.dam-rank-method summary::-webkit-details-marker { display: none; }
.dam-rank-method summary::after { margin-left: 6px; content: '?'; color: #0b8b80; }
.dam-rank-method[open] summary { border-color: #8bcfc5; background: #f0faf7; color: #087f75; }
.dam-rank-method > div { position: absolute; top: calc(100% + 7px); right: 0; z-index: 140; width: 390px; padding: 14px 15px; border: 1px solid #cfe0da; border-radius: 13px; background: #fff; box-shadow: 0 12px 30px rgba(27, 56, 46, .16); }
.dam-rank-method > div b { color: #2d463b; font-size: 15px; }
.dam-rank-method > div p { margin-top: 6px; font-size: 13px; line-height: 1.65; }
.dam-rank-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 17px 0 11px; }
.dam-rank-summary > span { display: grid; grid-template-columns: auto 1fr; align-items: end; min-height: 78px; padding: 13px 15px; border-radius: 12px; background: #f3f7f5; color: #596760; font-size: 14px; font-weight: 800; }
.dam-rank-summary > span:first-child { background: #eaf8f5; color: #087f75; }
.dam-rank-summary b { margin-right: 4px; color: #244437; font-size: 28px; line-height: 1; }
.dam-rank-summary > span:first-child b { color: #087f75; }
.dam-rank-summary small { grid-column: 1 / -1; margin-top: 5px; color: #6f7e77; font-size: 14px; }
.dam-rank-scope-panel[hidden] { display: none !important; }
.dam-rank-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 11px; }
.dam-rank-leader { position: relative; display: grid; grid-template-columns: auto 1fr auto; min-width: 0; min-height: 178px; align-content: start; gap: 10px; padding: 16px; overflow: hidden; border: 1px solid #dfe8e4; border-radius: 15px; background: #fbfcfc; color: #293d34; text-decoration: none; }
.dam-rank-leader:first-child { border-color: #8fd4c9; background: linear-gradient(145deg, #e9f9f5 0%, #fff 72%); box-shadow: inset 0 0 0 1px rgba(59, 166, 150, .08); }
.dam-rank-leader:hover { border-color: #83c7bd; transform: translateY(-1px); }
.dam-rank-medal { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 11px; background: #e8f2ee; color: #497064; font-size: 14px; font-weight: 950; }
.dam-rank-leader:first-child .dam-rank-medal { background: #0fa99c; color: #fff; }
.dam-rank-leader-title { display: grid; align-content: center; min-width: 0; }
.dam-rank-leader-title strong { overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.dam-rank-leader-title small { margin-top: 2px; color: #6e7c75; font-size: 14px; }
.dam-rank-score { align-self: center; color: #087f75; font-size: 25px; line-height: 1; }
.dam-rank-score small { margin-left: 2px; font-size: 9px; }
.dam-rank-leader > p { grid-column: 1 / -1; margin: 2px 0 0; color: #56665e; font-size: 15px; font-weight: 850; }
.dam-rank-leader-metrics { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; align-self: end; }
.dam-rank-leader-metrics span { display: grid; min-width: 0; gap: 3px; padding: 8px; border-radius: 9px; background: rgba(239, 244, 242, .86); color: #68776f; font-size: 13px; }
.dam-rank-leader-metrics b { overflow: hidden; color: #344b41; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.dam-rank-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 13px 15px; border: 1px solid #efd3ab; border-radius: 12px; background: #fff9ee; }
.dam-rank-notice b { color: #9b641d; font-size: 15px; }
.dam-rank-notice span { color: #826f56; font-size: 14px; }
.dam-rank-list { border: 1px solid #e1e8e5; border-radius: 13px; overflow: hidden; }
.dam-rank-list-head, .dam-rank-row { display: grid; grid-template-columns: 50px minmax(135px, 1.3fr) 68px 78px 78px 88px 72px 82px 17px; align-items: center; gap: 8px; padding: 0 12px; }
.dam-rank-list-head { min-height: 46px; background: #f3f6f5; color: #596860; font-size: 14px; font-weight: 900; text-align: right; }
.dam-rank-list-head span:nth-child(1), .dam-rank-list-head span:nth-child(2) { text-align: left; }
.dam-rank-row { min-height: 74px; border-top: 1px solid #edf1ef; color: #34473e; text-align: right; text-decoration: none; }
.dam-rank-row:hover { background: #f7fbf9; }
.dam-rank-row > span { min-width: 0; }
.dam-rank-row > span > b { display: block; font-size: 17px; }
.dam-rank-row > span > small { display: block; margin-top: 3px; color: #68766f; font-size: 14px; white-space: nowrap; }
.dam-rank-position, .dam-rank-identity { text-align: left; }
.dam-rank-position b { display: grid !important; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: #e7f7f3; color: #087f75; font-size: 16px !important; }
.dam-rank-position em { padding: 6px 8px; border-radius: 7px; background: #f0f2f1; color: #66716c; font-size: 13px; font-style: normal; font-weight: 900; }
.dam-rank-identity b { overflow: hidden; font-size: 18px !important; text-overflow: ellipsis; white-space: nowrap; }
.dam-rank-status { justify-self: end; padding: 7px 9px; border-radius: 8px; background: #eef3f0; color: #42544b; font-size: 15px; font-weight: 900; }
.dam-rank-offspring small { color: #61776d !important; }
.dam-rank-result { display: grid; justify-self: end; min-width: 65px; padding: 7px 8px; border-radius: 9px; background: #f0f4f2; text-align: center; }
.dam-rank-result b { color: #43574e; font-size: 20px !important; }
.dam-rank-result.excellent, .dam-rank-result.good { background: #e6f7f3; }
.dam-rank-result.excellent b, .dam-rank-result.good b { color: #087f75; }
.dam-rank-result.watch { background: #fff1e5; }
.dam-rank-result.watch b { color: #b96525; }
.dam-rank-arrow { color: #7c8b84; font-size: 20px; text-align: right; }
.dam-rank-more { margin: 9px 2px 0; color: #5f6e67; font-size: 14px; }
.dam-rank-empty { display: flex; min-height: 125px; align-items: center; justify-content: center; gap: 13px; border: 1px dashed #d5dfdb; border-radius: 14px; background: #fafcfb; }
.dam-rank-empty > span { display: grid; width: 41px; height: 41px; place-items: center; border-radius: 12px; background: #eaf3f0; color: #3d7665; font-size: 18px; }
.dam-rank-empty b { font-size: 16px; }
.dam-rank-empty p { margin: 4px 0 0; color: #68766f; font-size: 14px; }
.dam-rank-footnote { margin: 14px 2px 0; color: #5f6e67; font-size: 14px; line-height: 1.7; }
.family-rank-mobile-evidence { display: none; }

@media (max-width: 980px) {
    .dam-ranking-header { display: grid; }
    .dam-rank-controls { justify-content: space-between; }
    .dam-rank-list-head, .dam-rank-row { grid-template-columns: 44px minmax(125px, 1.3fr) 58px 70px 70px 79px 64px 72px 14px; gap: 6px; padding-right: 9px; padding-left: 9px; }
}

@media (max-width: 760px) {
    .dam-ranking { margin-right: -5px; margin-left: -5px; padding: 15px; }
    .dam-analysis-tabs { margin-bottom: 18px; }
    .dam-analysis-tabs button { min-height: 59px; padding: 9px 10px; font-size: 16px; line-height: 1.3; }
    .dam-ranking-header h2 { font-size: 25px; }
    .dam-ranking-header p { max-width: 350px; font-size: 13px; }
    .dam-rank-controls { align-items: flex-start; }
    .dam-rank-method > div { right: -1px; width: min(390px, calc(100vw - 42px)); }
    .dam-rank-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
    .dam-rank-summary > span { min-height: 61px; padding: 9px 11px; }
    .dam-rank-summary b { font-size: 20px; }
    .dam-rank-podium { display: flex; margin-right: -15px; margin-left: -2px; padding-right: 15px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
    .dam-rank-podium::-webkit-scrollbar { display: none; }
    .dam-rank-leader { flex: 0 0 min(285px, 84vw); min-height: 174px; scroll-snap-align: start; }
    .dam-rank-notice { align-items: flex-start; flex-direction: column; }
    .dam-rank-list-head { display: none; }
    .dam-rank-list { overflow: visible; border: 0; }
    .dam-rank-row { grid-template-columns: 43px minmax(0, 1fr) 82px; grid-template-rows: auto auto auto; gap: 6px 10px; min-height: 104px; margin-top: 7px; padding: 12px; border: 1px solid #e2e9e6; border-radius: 12px; background: #fff; text-align: left; }
    .dam-rank-position { grid-column: 1; grid-row: 1 / 4; align-self: center; }
    .dam-rank-identity { grid-column: 2; grid-row: 1; }
    .dam-rank-status { grid-column: 2; grid-row: 2; justify-self: start; }
    .dam-rank-offspring { display: flex; grid-column: 2; grid-row: 3; align-items: center; gap: 6px; }
    .dam-rank-offspring small { margin: 0 !important; }
    .dam-rank-row > span[data-label] { display: none; }
    .family-rank-mobile-evidence { display: flex; grid-column: 2; grid-row: 3; align-items: center; gap: 7px; }
    .family-rank-mobile-evidence small { margin: 0 !important; }
    .dam-rank-result { grid-column: 3; grid-row: 1 / 4; align-self: center; }
    .dam-rank-arrow { display: none; }
    .dam-rank-footnote { font-size: 14px; }
}

@media (max-width: 430px) {
    .dam-rank-controls { display: grid; grid-template-columns: 1fr auto; }
    .dam-rank-scope button { padding-right: 9px; padding-left: 9px; }
    .dam-rank-method summary { padding-right: 10px; padding-left: 10px; }
}

body.app-body { background: var(--modern-bg); color: var(--modern-ink); }
.app-sidebar { border-right: 1px solid var(--modern-line); background: #fff; box-shadow: none; }
.farm-brand-mark { border-radius: 14px; background: linear-gradient(145deg, #20c7b7, #0f9f93); box-shadow: 0 8px 20px rgba(23, 184, 170, .2); }
.farm-brand strong { color: var(--modern-ink); }
.side-nav-link { min-height: 50px; border-radius: 13px; color: #59635f; }
.side-nav-link:hover { background: #f1f8f6; color: var(--modern-teal-dark); }
.side-nav-link.active { background: #e9faf7; color: #087d75; box-shadow: inset 3px 0 var(--modern-teal); }
.side-nav-link.active .side-nav-icon { background: var(--modern-teal); color: #fff; }
.app-topbar { border-bottom-color: var(--modern-line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.app-main { width: min(1380px, calc(100% - 48px)); }
.card { border-color: var(--modern-line); border-radius: 18px; box-shadow: 0 3px 14px rgba(27, 49, 42, .045); }
.btn { border-radius: 12px; background: var(--modern-teal-dark); box-shadow: none; }
.btn:hover { background: #06766f; transform: translateY(-1px); }
.btn-secondary { border-color: #dfe5e2; background: #f4f6f5; color: #4f5b56; }
.modern-primary { background: var(--modern-teal); }
.page-title-copy h1 { letter-spacing: -.04em; }
.eyebrow { color: var(--modern-teal-dark); }
.global-record-fab { display: none; }

/* 키우소의 장점을 반영한 오늘 할 일 홈 */
.modern-today-board { margin: 0 0 22px; padding: 24px; border: 1px solid var(--modern-line); border-radius: 22px; background: #fff; }
.modern-today-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 17px; }
.modern-today-heading span { color: var(--modern-muted); font-size: 14px; font-weight: 800; }
.modern-today-heading h2 { margin: 3px 0 0; font-size: clamp(25px, 3vw, 34px); }
.modern-today-heading h2 b { color: var(--modern-teal); }
.modern-today-heading a { color: var(--modern-teal-dark); font-weight: 850; text-decoration: none; }
.modern-today-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.today-color-card { display: grid; min-height: 128px; padding: 18px; border-radius: 20px; color: #fff; text-decoration: none; }
.today-color-card span { font-size: 15px; font-weight: 850; }
.today-color-card strong { align-self: end; font-size: 36px; line-height: 1; }
.today-color-card small { margin-top: 7px; color: rgba(255,255,255,.9); font-weight: 750; }
.today-color-card.coral { background: linear-gradient(145deg, #ff6b73, #ff4360); }
.today-color-card.blue { background: linear-gradient(145deg, #4da4f5, #287be2); }
.today-color-card.amber { background: linear-gradient(145deg, #ffb326, #ff9412); }
.today-color-card.gray { background: linear-gradient(145deg, #a8adaa, #838986); }
.modern-home-shortcuts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--modern-line); }
.modern-home-shortcuts a { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 52px; border-radius: 13px; color: #28322e; font-weight: 850; text-decoration: none; }
.modern-home-shortcuts a:hover { background: #f2f8f6; color: var(--modern-teal-dark); }
.modern-home-shortcuts span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: #e5f8f5; color: var(--modern-teal-dark); }
.featured-record-action { border-color: #a9e4db !important; background: #edfbf8 !important; }

/* 공통 현대식 페이지 */
.modern-page-header { align-items: flex-end; }
.modern-count { color: var(--modern-teal-dark); font-size: 20px; }
.modern-filter-card { margin-bottom: 22px; padding: 16px 18px; }
.records-filter-form { display: grid; grid-template-columns: 190px 160px minmax(220px, 1fr) auto; align-items: end; gap: 12px; }
.records-filter-form label { display: grid; gap: 6px; }
.records-filter-form label > span { color: #66716c; font-size: 13px; font-weight: 850; }
.records-filter-form select,
.records-filter-form input { min-height: 48px; }

.record-type-launcher { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 11px; margin-bottom: 18px; }
.record-type-button { display: grid; min-height: 116px; place-items: center; align-content: center; gap: 8px; border: 1px solid var(--modern-line); border-radius: 20px; background: #fff; color: var(--modern-ink); text-decoration: none; box-shadow: 0 3px 12px rgba(30, 51, 44, .04); }
.record-type-button > span { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 16px; background: var(--modern-coral); color: #fff; font-size: 20px; font-weight: 900; }
.record-type-button:nth-child(n+3):nth-child(-n+6) > span { background: var(--modern-blue); }
.record-type-button:nth-child(n+7):nth-child(-n+9) > span { background: var(--modern-amber); }
.record-type-button:nth-child(n+10) > span { background: #7a807d; }
.record-type-button strong { font-size: 15px; }
.record-type-button:hover { border-color: #a6dcd5; transform: translateY(-2px); }

.modern-event-list { display: grid; gap: 9px; }
.modern-event-row { display: grid; grid-template-columns: 52px minmax(130px, .7fr) minmax(220px, 1.5fr) auto auto; align-items: center; gap: 13px; padding: 14px 16px; border: 1px solid var(--modern-line); border-radius: 17px; background: #fff; }
.modern-event-row.is-todo { border-color: #f0cf91; background: #fffbf2; }
.event-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 15px; background: #ecefed; color: #606964; font-weight: 900; }
.event-icon.coral { background: #ffebed; color: #e84452; }
.event-icon.blue { background: #e8f3ff; color: #2678d1; }
.event-icon.amber { background: #fff3d9; color: #b56d00; }
.event-cow { display: grid; color: var(--modern-ink); text-decoration: none; }
.event-cow strong { font-size: 17px; }
.event-cow small { margin-top: 3px; color: var(--modern-muted); }
.event-main { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 8px; min-width: 0; }
.event-main > small { grid-column: 1 / -1; overflow: hidden; color: var(--modern-muted); text-overflow: ellipsis; white-space: nowrap; }
.event-type-chip { padding: 3px 7px; border-radius: 7px; background: #edf1ef; color: #53605a; font-size: 12px; font-weight: 850; }
.event-due { display: grid; justify-items: end; color: #69736e; font-size: 12px; }
.event-due strong { margin-top: 3px; color: #3c4943; font-size: 14px; }
.event-actions { display: flex; align-items: center; gap: 6px; }
.event-actions form { margin: 0; }
.record-delete-button { border: 0; background: transparent; color: #a36262; cursor: pointer; }

.inventory-section { margin-top: 35px; }
.inventory-layout { display: grid; grid-template-columns: minmax(330px, .8fr) minmax(0, 1.6fr); gap: 16px; align-items: start; }
.inventory-add-card { padding: 20px; }
.inventory-add-card h3 { margin: 0 0 17px; }
.inventory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.inventory-card { position: relative; min-height: 172px; padding: 17px; border: 1px solid var(--modern-line); border-radius: 17px; background: #fff; }
.inventory-card > span { color: var(--modern-teal-dark); font-size: 12px; font-weight: 850; }
.inventory-card > strong { display: block; margin-top: 4px; font-size: 18px; }
.inventory-card p { margin: 16px 0 5px; color: #69736e; }
.inventory-card p b { margin-right: 4px; color: var(--modern-ink); font-size: 28px; }
.inventory-card small { color: var(--modern-muted); }
.inventory-card em { position: absolute; top: 14px; right: 14px; padding: 4px 7px; border-radius: 7px; background: #fff0e3; color: #b25713; font-size: 11px; font-style: normal; font-weight: 850; }
.inventory-card.is-low { border-color: #efc083; background: #fffbf4; }
.inventory-card form { position: absolute; right: 13px; bottom: 11px; margin: 0; }
.inventory-card form button { border: 0; background: transparent; color: #9b6969; cursor: pointer; }
.small-empty { grid-column: 1 / -1; }
.large-check-label { display: grid; grid-template-columns: auto 1fr; gap: 2px 9px; margin-top: 18px; padding: 15px; border: 1px solid var(--modern-line); border-radius: 13px; background: #f8faf9; cursor: pointer; }
.large-check-label input { grid-row: 1 / 3; width: 24px; height: 24px; margin: 2px; accent-color: var(--modern-teal); }
.large-check-label span { font-weight: 850; }
.large-check-label small { color: var(--modern-muted); }

/* 가계부 - 금액과 사료·소모품 재고 흐름 */
.ledger-page-header { align-items: flex-end; }
.ledger-quick-guide { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 15px; padding: 16px 19px; border: 1px solid #dce6e2; border-radius: 17px; background: linear-gradient(135deg, #f1faf7, #fff); }
.ledger-quick-guide div { display: grid; gap: 2px; }
.ledger-quick-guide b { color: #244138; font-size: 13px; }
.ledger-quick-guide span { color: var(--modern-muted); font-size: 10px; }
.ledger-quick-guide i { color: #9bb4aa; font-size: 20px; font-style: normal; font-weight: 900; }
.ledger-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.ledger-section-heading h2 { margin: 3px 0 2px; font-size: 23px; letter-spacing: -.03em; }
.ledger-section-heading p { margin: 0; color: var(--modern-muted); font-size: 11px; }
.ledger-section-heading > a:not(.btn) { color: var(--modern-teal-dark); font-weight: 900; text-decoration: none; }
.ledger-stock-section { margin: 19px 0; scroll-margin-top: 85px; }
.ledger-stock-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ledger-stock-card { padding: 17px; border: 1px solid #dfe8e4; border-radius: 17px; background: #fff; box-shadow: 0 3px 12px rgba(31,58,49,.04); }
.ledger-stock-card.low { border-color: #efc98f; background: #fffaf2; }
.ledger-stock-card.negative { border-color: #ebb3b7; background: #fff6f6; }
.ledger-stock-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ledger-stock-card header > div { display: grid; gap: 5px; }
.ledger-stock-card header span { color: #61706a; font-size: 12px; font-weight: 900; }
.ledger-stock-card header strong { font-size: 30px; line-height: 1; }
.ledger-stock-card header strong small { margin-left: 4px; color: var(--modern-muted); font-size: 12px; }
.ledger-stock-card header em { padding: 5px 7px; border-radius: 7px; background: #fff0d9; color: #a2610d; font-size: 9px; font-style: normal; font-weight: 900; }
.ledger-stock-card.negative header em { background: #ffe3e4; color: #bd434d; }
.ledger-stock-card dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 15px 0 10px; }
.ledger-stock-card dl div { padding: 8px 9px; border-radius: 10px; background: #f4f7f6; }
.ledger-stock-card dt { color: #7d8782; font-size: 9px; font-weight: 800; }
.ledger-stock-card dd { margin: 2px 0 0; color: #46544e; font-size: 11px; font-weight: 900; }
.ledger-stock-card > p { min-height: 27px; margin: 0 0 11px; color: #69756f; font-size: 10px; }
.ledger-stock-card > p b { color: var(--modern-teal-dark); }
.ledger-stock-card > div:last-child { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.ledger-stock-card .btn { min-height: 39px; padding: 8px 11px; font-size: 11px; text-decoration: none; }
.ledger-stock-empty { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px; padding: 20px; border: 1px dashed #cddbd5; border-radius: 17px; background: #f8fbfa; }
.ledger-stock-empty > span { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; background: #e2f6f1; color: var(--modern-teal-dark); font-size: 20px; font-weight: 900; }
.ledger-stock-empty strong { font-size: 16px; }
.ledger-stock-empty p { margin: 4px 0 0; color: var(--modern-muted); font-size: 11px; }
.ledger-filter-card { margin-bottom: 12px; }
.ledger-history-card { overflow: hidden; }
.ledger-kind-badge { border: 0; }
.ledger-kind-badge.income { background: #def5ed; color: #167250; }
.ledger-kind-badge.expense { background: #ffe8e8; color: #ac3f47; }
.ledger-kind-badge.purchase { background: #e4f1ff; color: #286fae; }
.ledger-kind-badge.usage { background: #fff0db; color: #a76010; }
.ledger-amount.purchase, .ledger-quantity.purchase { color: #2476b7; }
.ledger-amount.usage, .ledger-quantity.usage { color: #b66a13; }
.ledger-entry-form { display: grid; gap: 14px; padding: 22px; }
.ledger-kind-section { padding-bottom: 17px; border-bottom: 1px solid var(--modern-line); }
.ledger-kind-section h2 { margin: 3px 0 13px; font-size: 21px; }
.ledger-kind-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ledger-kind-option { position: relative; display: grid; min-height: 108px; place-items: center; align-content: center; gap: 4px; padding: 12px; border: 1px solid #dfe7e4; border-radius: 15px; background: #f9fbfa; cursor: pointer; }
.ledger-kind-option input { position: absolute; opacity: 0; pointer-events: none; }
.ledger-kind-option > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: #e8efec; color: #53625b; font-size: 16px; font-weight: 900; }
.ledger-kind-option strong { font-size: 13px; }
.ledger-kind-option small { color: var(--modern-muted); font-size: 9px; text-align: center; }
.ledger-kind-option.active { border-color: #68c4b8; background: #eaf9f6; box-shadow: inset 0 0 0 1px #afe3dc; }
.ledger-kind-option.active > span { background: var(--modern-teal); color: #fff; }
.ledger-kind-guide { margin: 11px 0 0; padding: 10px 12px; border-radius: 10px; background: #edf7f4; color: #54655e; font-size: 11px; }
.ledger-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.ledger-value-block { display: grid; grid-template-columns: minmax(170px, .6fr) minmax(0, 1.4fr); align-items: center; gap: 16px; padding: 16px; border: 1px solid #dfe8e4; border-radius: 15px; background: #f9fbfa; }
.ledger-value-block[hidden], .ledger-entry-form [hidden] { display: none !important; }
.ledger-value-block.money { background: #fffaf2; }
.ledger-value-block.quantity { background: #f0f8ff; }
.ledger-value-heading { display: flex; align-items: center; gap: 10px; }
.ledger-value-heading > span { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 12px; background: #fff0d8; color: #9e650c; font-size: 18px; font-weight: 900; }
.ledger-value-block.quantity .ledger-value-heading > span { background: #deefff; color: #2871b2; }
.ledger-value-heading div { display: grid; gap: 2px; }
.ledger-value-heading strong { font-size: 15px; }
.ledger-value-heading small { color: var(--modern-muted); font-size: 9px; }
.ledger-quantity-fields { display: grid; grid-template-columns: 1fr 130px; gap: 8px; }
.ledger-save-bar { position: sticky; bottom: 10px; z-index: 90; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 11px 12px; border: 1px solid #b7ddd6; border-radius: 13px; background: rgba(241,250,247,.97); box-shadow: 0 8px 25px rgba(24,74,61,.1); backdrop-filter: blur(9px); }
.ledger-save-bar > span { color: #5f6d67; font-size: 11px; font-weight: 850; }
.ledger-summary-stock { margin-top: 18px; padding: 21px; }
.ledger-summary-stock-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ledger-summary-stock-grid > div { position: relative; display: grid; min-height: 115px; padding: 13px; border-radius: 13px; background: #f4f8f6; }
.ledger-summary-stock-grid span { color: #61706a; font-size: 11px; font-weight: 850; }
.ledger-summary-stock-grid strong { align-self: end; margin-top: 7px; font-size: 24px; }
.ledger-summary-stock-grid strong small { margin-left: 3px; color: var(--modern-muted); font-size: 10px; }
.ledger-summary-stock-grid p { margin: 4px 0 0; color: #77817c; font-size: 9px; }
.ledger-summary-stock-grid em { position: absolute; top: 10px; right: 10px; color: #9f640f; font-size: 8px; font-style: normal; font-weight: 900; }
.ledger-summary-stock-grid .low { background: #fff7e9; }
.ledger-summary-stock-grid .negative { background: #fff0f1; }

/* 통계 */
.stats-hero-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.modern-stat-card { display: grid; grid-template-columns: 1fr auto; align-items: end; min-height: 116px; padding: 19px; border: 1px solid var(--modern-line); border-radius: 18px; background: #fff; }
.modern-stat-card span { grid-column: 1 / -1; color: var(--modern-muted); font-weight: 850; }
.modern-stat-card strong { font-size: 36px; }
.modern-stat-card small { margin-bottom: 5px; color: var(--modern-muted); }
.modern-stat-card.primary { border: 0; background: linear-gradient(145deg, #25cabb, #10aa9d); color: #fff; }
.modern-stat-card.primary span,
.modern-stat-card.primary small { color: rgba(255,255,255,.9); }
.statistics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.stat-panel { padding: 21px; }
.stat-bar-list { display: grid; gap: 13px; margin-top: 14px; }
.stat-bar-row { display: grid; grid-template-columns: minmax(90px, 140px) minmax(100px, 1fr) auto; align-items: center; gap: 10px; }
.stat-bar-row > span { overflow: hidden; color: #56625c; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.stat-bar-row > div { height: 9px; overflow: hidden; border-radius: 999px; background: #eaf0ed; }
.stat-bar-row i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #21c1b2, #328bea); }
.stat-bar-row strong { min-width: 38px; color: #2774c7; text-align: right; }
.stat-empty { color: var(--modern-muted); }
.slaughter-stat-panel { margin-top: 15px; padding: 22px; }
.slaughter-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.slaughter-stat-grid > div { display: grid; min-height: 105px; padding: 15px; border-radius: 14px; background: #f4f7f6; }
.slaughter-stat-grid span { color: var(--modern-muted); font-weight: 800; }
.slaughter-stat-grid strong { align-self: end; font-size: 28px; }
.slaughter-stat-grid small { color: var(--modern-muted); }
.grade-chip-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.grade-chip-list span { padding: 8px 10px; border-radius: 9px; background: #edf5f3; color: #4f5d57; font-size: 13px; }

/* 목장 통계 - 대분류와 번식·가계부 분석 */
.farm-stat-tabs { position: sticky; top: 72px; z-index: 120; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-bottom: 17px; padding: 6px; border: 1px solid #dde6e2; border-radius: 17px; background: rgba(255,255,255,.94); box-shadow: 0 6px 20px rgba(30,58,49,.07); backdrop-filter: blur(12px); }
.farm-stat-tabs button { display: flex; min-height: 48px; align-items: center; justify-content: center; gap: 7px; padding: 8px 12px; border: 0; border-radius: 12px; background: transparent; color: #66726c; font: inherit; font-size: 13px; font-weight: 900; white-space: nowrap; cursor: pointer; }
.farm-stat-tabs button span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; background: #eef2f0; color: #68756f; font-size: 14px; }
.farm-stat-tabs button:hover { background: #f3f8f6; color: var(--modern-teal-dark); }
.farm-stat-tabs button.active { background: #e6f8f4; color: #087d75; box-shadow: inset 0 0 0 1px #c4e9e2; }
.farm-stat-tabs button.active span { background: var(--modern-teal); color: #fff; }
.farm-stat-panel[hidden] { display: none !important; }
.farm-stat-panel.active { animation: farm-stat-enter .18s ease-out; }
@keyframes farm-stat-enter { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.farm-stat-intro { display: flex; min-height: 112px; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 13px; padding: 22px 24px; overflow: hidden; border-radius: 19px; background: linear-gradient(125deg, #e7f8f4, #f7fbfa); }
.farm-stat-intro > div:first-child { position: relative; z-index: 1; }
.farm-stat-intro span { color: var(--modern-teal-dark); font-size: 12px; font-weight: 900; }
.farm-stat-intro h2 { margin: 4px 0 5px; font-size: 25px; letter-spacing: -.035em; }
.farm-stat-intro p { margin: 0; color: #65716b; font-size: 12px; }
.farm-stat-intro > a, .farm-stat-intro-actions a { flex: 0 0 auto; color: var(--modern-teal-dark); font-size: 13px; font-weight: 900; text-decoration: none; }
.farm-stat-intro.ledger { background: linear-gradient(125deg, #fff4df, #fffaf2); }
.farm-stat-intro.ledger span, .farm-stat-intro.ledger a { color: #9a6208; }
.farm-stat-intro.breeding { background: linear-gradient(125deg, #e9f4ff, #f7fbff); }
.farm-stat-intro.breeding span, .farm-stat-intro.breeding > a { color: #2673bd; }
.farm-stat-intro.open-days { background: linear-gradient(125deg, #fff0f1, #fff9f8); }
.farm-stat-intro.open-days span, .farm-stat-intro.open-days > a { color: #bf505a; }
.farm-stat-intro-actions { display: flex; align-items: center; gap: 13px; }
.analytics-kpi-grid { display: grid; gap: 9px; margin-bottom: 12px; }
.analytics-kpi-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.analytics-kpi { display: grid; min-height: 116px; padding: 16px; border: 1px solid #e2e9e6; border-radius: 16px; background: #fff; }
.analytics-kpi span { color: #68736e; font-size: 12px; font-weight: 900; }
.analytics-kpi strong { align-self: end; margin-top: 9px; color: var(--modern-ink); font-size: 28px; line-height: 1; }
.analytics-kpi small { margin-top: 5px; color: #7b8580; font-size: 10px; }
.analytics-kpi.primary { border-color: #9fdad2; background: linear-gradient(145deg, #e5f9f5, #f8fcfb); }
.analytics-kpi.income, .analytics-kpi.positive { border-color: #addfd7; background: #f1faf8; }
.analytics-kpi.income strong, .analytics-kpi.positive strong { color: #087f75; }
.analytics-kpi.expense, .analytics-kpi.warning { border-color: #f0cfa3; background: #fff9ef; }
.analytics-kpi.expense strong, .analytics-kpi.warning strong { color: #be711b; }
.analytics-kpi.negative { border-color: #edc3c6; background: #fff6f6; }
.analytics-kpi.negative strong { color: #c44c56; }
.analytics-card { padding: 21px; }
.analytics-card + .analytics-card { margin-top: 0; }
.analytics-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.analytics-heading span { color: var(--modern-teal-dark); font-size: 11px; font-weight: 900; }
.analytics-heading h3 { margin: 3px 0 0; font-size: 19px; letter-spacing: -.025em; }
.analytics-heading p { margin: 4px 0 0; color: var(--modern-muted); font-size: 11px; }
.analytics-two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.analytics-footnote { margin: 12px 0 0; padding: 11px 13px; border-radius: 11px; background: #f1f4f3; color: #68736e; font-size: 10px; line-height: 1.55; }
.analytics-insight { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 14px 16px; border: 1px solid #dfe8e4; border-radius: 15px; background: #f7f9f8; }
.analytics-insight > span { display: grid; flex: 0 0 38px; height: 38px; place-items: center; border-radius: 12px; background: #fff; color: var(--modern-teal-dark); font-size: 18px; font-weight: 900; box-shadow: 0 3px 9px rgba(30,55,47,.07); }
.analytics-insight.good { border-color: #a9ded6; background: #effaf7; }
.analytics-insight p { margin: 3px 0 0; color: #69746f; font-size: 11px; }
.ledger-legend { display: flex; align-items: center; gap: 6px; color: #69746f; font-size: 11px; font-weight: 850; }
.ledger-legend i { width: 9px; height: 9px; margin-left: 7px; border-radius: 3px; background: var(--modern-teal); }
.ledger-legend i.expense { background: #ff9c4c; }
.ledger-month-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 7px; height: 210px; padding-top: 8px; }
.ledger-month { display: grid; grid-template-rows: 1fr auto auto; gap: 3px; min-width: 0; color: #68736e; text-align: center; }
.ledger-bars { display: flex; height: 164px; align-items: end; justify-content: center; gap: 3px; border-bottom: 1px solid #dfe6e3; }
.ledger-bars i { width: min(12px, 38%); min-height: 0; border-radius: 5px 5px 1px 1px; background: var(--modern-teal); }
.ledger-bars i.expense { background: #ff9c4c; }
.ledger-month strong { font-size: 10px; }
.ledger-month small { min-height: 11px; font-size: 8px; }
.category-rank-list { display: grid; gap: 13px; }
.category-rank-list > div { display: grid; grid-template-columns: minmax(100px, 1fr) 2fr auto; align-items: center; gap: 9px; }
.category-rank-list span { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.category-rank-list span b { color: #53605a; font-size: 12px; }
.category-rank-list span small { color: #89928e; font-size: 9px; }
.category-rank-list i { height: 7px; overflow: hidden; border-radius: 999px; background: #edf1ef; }
.category-rank-list i em { display: block; height: 100%; border-radius: inherit; background: #ff9c4c; }
.category-rank-list.income i em { background: var(--modern-teal); }
.category-rank-list strong { color: #52605a; font-size: 11px; }
.analytics-empty-state { display: grid; min-height: 390px; place-items: center; align-content: center; padding: 38px; text-align: center; }
.analytics-empty-icon { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 19px; background: #fff1da; color: #ad7118; font-size: 27px; font-weight: 900; }
.analytics-empty-state h3 { margin: 15px 0 5px; font-size: 22px; }
.analytics-empty-state > p { max-width: 540px; margin: 0; color: var(--modern-muted); font-size: 12px; }
.analytics-empty-preview { display: grid; grid-template-columns: repeat(3, 1fr); width: min(690px, 100%); gap: 9px; margin: 22px 0; }
.analytics-empty-preview div { display: grid; min-height: 108px; place-items: center; align-content: center; gap: 4px; padding: 13px; border-radius: 14px; background: #f7f9f8; }
.analytics-empty-preview b { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 9px; background: #e5f6f2; color: var(--modern-teal-dark); font-size: 12px; }
.analytics-empty-preview span { font-size: 13px; font-weight: 900; }
.analytics-empty-preview small { color: var(--modern-muted); font-size: 10px; }
.breeding-month-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.breeding-month-card { position: relative; display: grid; min-height: 155px; padding: 13px; border: 1px solid #e3e9e6; border-radius: 14px; background: #fafcfb; }
.breeding-month-card.best { border-color: #75c9bd; background: #eefaf7; box-shadow: inset 0 0 0 1px #b9e7df; }
.breeding-month-card.best::after { position: absolute; top: 8px; right: 8px; content: 'BEST'; padding: 3px 5px; border-radius: 5px; background: var(--modern-teal); color: #fff; font-size: 7px; font-weight: 900; }
.breeding-month-card header { display: flex; align-items: center; justify-content: space-between; }
.breeding-month-card header strong { font-size: 13px; }
.breeding-month-card header small { color: #7d8782; font-size: 9px; }
.month-volume { height: 5px; margin: 9px 0 10px; overflow: hidden; border-radius: 999px; background: #e8eeeb; }
.month-volume i { display: block; height: 100%; border-radius: inherit; background: #428ed9; }
.breeding-month-card > b { align-self: end; font-size: 28px; line-height: 1; }
.breeding-month-card > b small { font-size: 12px; }
.breeding-month-card p { margin: 5px 0 0; color: #68736e; font-size: 9px; }
.breeding-month-card em { margin-top: 4px; color: #b4732c; font-size: 8px; font-style: normal; }
.compact-stat-table { display: grid; }
.compact-stat-table > div { display: grid; grid-template-columns: 1fr repeat(3, 1fr); align-items: center; min-height: 42px; border-bottom: 1px solid #edf1ef; color: #64706a; font-size: 11px; text-align: right; }
.compact-stat-table > div > :first-child { text-align: left; }
.compact-stat-table .compact-stat-head { min-height: 30px; color: #8a938f; font-size: 9px; font-weight: 850; }
.compact-stat-table strong { color: var(--modern-teal-dark); }
.recent-analytics-list { display: grid; }
.recent-analytics-list a { display: flex; min-height: 51px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf1ef; color: var(--modern-ink); text-decoration: none; }
.recent-analytics-list a > span { display: grid; gap: 2px; }
.recent-analytics-list small { color: var(--modern-muted); font-size: 9px; }
.recent-analytics-list em { padding: 5px 7px; border-radius: 7px; background: #edf1ef; color: #66716c; font-size: 9px; font-style: normal; font-weight: 900; }
.recent-analytics-list em.good { background: #e1f6f2; color: #087f75; }
.recent-analytics-list em.watch { background: #fff0e2; color: #b66422; }
.open-days-distribution { display: grid; gap: 14px; }
.open-days-distribution > div { display: grid; grid-template-columns: 110px minmax(100px, 1fr) auto; align-items: center; gap: 9px; }
.open-days-distribution span { display: flex; align-items: center; justify-content: space-between; }
.open-days-distribution b { color: #53605a; font-size: 11px; }
.open-days-distribution span small { color: #88918d; font-size: 9px; }
.open-days-distribution i { height: 8px; overflow: hidden; border-radius: 999px; background: #edf1ef; }
.open-days-distribution i em { display: block; height: 100%; border-radius: inherit; background: #428ed9; }
.open-days-distribution .good i em { background: var(--modern-teal); }
.open-days-distribution .watch i em { background: #f3a446; }
.open-days-distribution .danger i em { background: #ed6a72; }
.open-days-distribution strong { min-width: 35px; color: #52605a; font-size: 11px; text-align: right; }
.followup-card { margin-top: 12px; }
.open-days-table { min-width: 760px; }
.open-days-table td:last-child a { color: var(--modern-teal-dark); font-weight: 900; text-decoration: none; }
.followup-status { padding: 5px 7px; border-radius: 7px; background: #fff2e4; color: #ad641f; font-size: 9px; font-weight: 900; }

/* 목장 통계 - 도축 성적 분석 */
.slaughter-analysis { margin-top: 16px; padding: 23px; }
.farm-stat-panel .slaughter-analysis { margin-top: 0; }
.slaughter-analysis-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.slaughter-analysis-header h2 { margin: 3px 0 5px; font-size: 27px; letter-spacing: -.035em; }
.slaughter-analysis-header p { margin: 0; color: var(--modern-muted); font-size: 13px; }
.slaughter-sales-link { flex: 0 0 auto; color: var(--modern-teal-dark); font-weight: 900; text-decoration: none; }
.slaughter-filter-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 17px 0 13px; }
.slaughter-period-tabs, .slaughter-cohort-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: #eef2f0; }
.slaughter-period-tabs a, .slaughter-cohort-tabs a { min-width: 70px; padding: 8px 12px; border-radius: 9px; color: #68736e; font-size: 13px; font-weight: 850; text-align: center; text-decoration: none; }
.slaughter-period-tabs a.active, .slaughter-cohort-tabs a.active { background: #fff; color: var(--modern-teal-dark); box-shadow: 0 3px 9px rgba(27,49,42,.09); }
.slaughter-cohort-tabs { background: #e5f6f2; }
.slaughter-kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.slaughter-kpi { display: grid; min-height: 112px; padding: 15px; border: 1px solid #e4eae7; border-radius: 15px; background: #f7f9f8; }
.slaughter-kpi.primary { border-color: #a5ddd6; background: linear-gradient(145deg, #e5f9f5, #f5fcfa); }
.slaughter-kpi.price { background: #fffaf0; }
.slaughter-kpi span { color: #64706b; font-size: 13px; font-weight: 850; }
.slaughter-kpi strong { align-self: end; margin-top: 7px; color: var(--modern-ink); font-size: 27px; line-height: 1; }
.slaughter-kpi small { margin-top: 5px; color: #7b8580; font-size: 11px; }
.slaughter-assessment { display: flex; align-items: center; gap: 13px; margin-top: 13px; padding: 15px 17px; border: 1px solid #dfe7e3; border-radius: 15px; background: #f5f8f6; }
.slaughter-assessment.good { border-color: #a7ddd5; background: #edf9f6; }
.slaughter-assessment.watch { border-color: #f0c5a2; background: #fff6ed; }
.slaughter-assessment.mixed { border-color: #bdd6ed; background: #f1f7fc; }
.assessment-icon { display: grid; flex: 0 0 43px; height: 43px; place-items: center; border-radius: 13px; background: #fff; color: var(--modern-teal-dark); font-size: 22px; font-weight: 900; box-shadow: 0 3px 9px rgba(30,55,47,.08); }
.slaughter-assessment.watch .assessment-icon { color: #d77927; }
.slaughter-assessment strong { font-size: 16px; }
.slaughter-assessment p { margin: 3px 0 0; color: #64706b; font-size: 12px; }
.slaughter-comparison-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.slaughter-comparison { display: grid; min-height: 87px; padding: 12px; border-radius: 12px; background: #f4f7f6; }
.slaughter-comparison span { color: #68736e; font-size: 11px; font-weight: 850; }
.slaughter-comparison strong { align-self: end; margin-top: 5px; font-size: 19px; }
.slaughter-comparison small { margin-top: 3px; color: #7b8580; font-size: 10px; }
.slaughter-comparison.good strong, .slaughter-comparison.good small { color: #07877d; }
.slaughter-comparison.watch strong, .slaughter-comparison.watch small { color: #d26647; }
.slaughter-coverage { display: grid; grid-template-columns: minmax(155px, 1.25fr) repeat(4, minmax(125px, 1fr)); align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px dashed #d9e2de; border-radius: 13px; }
.slaughter-coverage > div { display: grid; gap: 2px; }
.slaughter-coverage > div small { color: #7a8580; font-size: 10px; }
.slaughter-coverage > span { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 7px; }
.slaughter-coverage > span b { color: #606c66; font-size: 10px; }
.slaughter-coverage > span i { grid-column: 1; height: 5px; overflow: hidden; border-radius: 999px; background: #e7ecea; }
.slaughter-coverage > span em { display: block; height: 100%; border-radius: inherit; background: var(--modern-teal); }
.slaughter-coverage > span small { grid-column: 2; grid-row: 1 / 3; color: #53615b; font-size: 11px; font-weight: 900; }
.slaughter-detail-tabs { display: flex; gap: 5px; margin-top: 18px; padding: 5px; border-bottom: 1px solid #e2e8e5; overflow-x: auto; }
.slaughter-detail-tabs button { flex: 1 0 auto; min-height: 42px; padding: 7px 14px; border: 0; border-radius: 10px; background: transparent; color: #69746f; font: inherit; font-size: 13px; font-weight: 900; cursor: pointer; }
.slaughter-detail-tabs button.active { background: #e9f8f5; color: var(--modern-teal-dark); }
.slaughter-detail-panel { padding-top: 16px; }
.slaughter-detail-panel[hidden] { display: none !important; }
.slaughter-panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.slaughter-panel-heading h3 { margin: 0; font-size: 18px; }
.slaughter-panel-heading p { margin: 3px 0 0; color: var(--modern-muted); font-size: 11px; }
.slaughter-table-scroll { width: 100%; overflow-x: auto; border: 1px solid #e3e9e6; border-radius: 13px; }
.slaughter-table { width: 100%; min-width: 790px; border-collapse: collapse; background: #fff; font-size: 12px; }
.slaughter-table th, .slaughter-table td { padding: 11px 12px; border-bottom: 1px solid #edf0ee; text-align: right; white-space: nowrap; }
.slaughter-table thead th { background: #f5f8f6; color: #68736e; font-size: 10px; }
.slaughter-table th:first-child, .slaughter-table td:first-child { text-align: left; }
.slaughter-table tbody tr:last-child th, .slaughter-table tbody tr:last-child td { border-bottom: 0; }
.slaughter-table tbody tr:hover { background: #f8fcfa; }
.slaughter-table a { color: var(--modern-teal-dark); font-weight: 900; text-decoration: none; }
.slaughter-table small { color: #87918c; font-size: 9px; }
.stat-not-provided { color: #9a8170; font-size: 10px; font-weight: 800; }
.stat-age-warning { color: #c86445; font-size: 10px; font-weight: 900; }
.slaughter-distribution-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.slaughter-distribution-grid > section { padding: 15px; border: 1px solid #e3e9e6; border-radius: 14px; }
.slaughter-grade-list { display: grid; gap: 7px; }
.slaughter-grade-row { display: grid; grid-template-columns: 42px minmax(80px, 1fr) auto; align-items: center; gap: 3px 8px; padding: 8px 9px; border-radius: 10px; background: #f7f9f8; }
.slaughter-grade-row > b { grid-row: 1 / 3; font-size: 15px; }
.slaughter-grade-row > span { height: 7px; overflow: hidden; border-radius: 999px; background: #e6ece9; }
.slaughter-grade-row > span i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1fc4b5, #0f9288); }
.slaughter-grade-row > strong { font-size: 11px; }
.slaughter-grade-row > small { grid-column: 2 / 4; color: #707b76; font-size: 9px; }
.slaughter-weight-list { display: grid; gap: 9px; }
.slaughter-weight-list > div { display: grid; grid-template-columns: 83px minmax(70px, 1fr) auto auto; align-items: center; gap: 8px; font-size: 11px; }
.slaughter-weight-list i { height: 8px; overflow: hidden; border-radius: 999px; background: #e7ecea; }
.slaughter-weight-list em { display: block; height: 100%; border-radius: inherit; background: #5b9fe3; }
.slaughter-weight-list strong { min-width: 31px; text-align: right; }
.slaughter-weight-list small { min-width: 39px; color: #7a8580; text-align: right; }
.house-table { min-width: 820px; }
.recent-slaughter-table { min-width: 920px; }
.slaughter-grade-badge { padding: 4px 7px; border-radius: 7px; background: #eef7f4; color: #087d75; }
.slaughter-analysis-note { margin: 15px 0 0; padding: 10px 12px; border-radius: 10px; background: #f5f7f6; color: #69746f; font-size: 10px; line-height: 1.55; }

/* 사진 중심 개체 UX */
.cow-profile-hero { grid-template-columns: auto minmax(0, 1.1fr) minmax(300px, .9fr); }
.cow-profile-photo { display: grid; width: 118px; height: 118px; overflow: hidden; place-items: center; border: 4px solid #fff; border-radius: 24px; background: #eaf3f0; box-shadow: 0 8px 24px rgba(29, 61, 50, .13); }
.cow-profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.cow-profile-photo span { font-size: 48px; }
.cow-primary-actions { grid-column: 1 / -1; }
.photo-edit-preview { display: block; width: 150px; height: 110px; margin: 8px 0 12px; border-radius: 13px; object-fit: cover; }
.cow-card-main { position: relative; display: flex; align-items: flex-start; gap: 12px; }
.cow-list-photo { flex: 0 0 92px; width: 92px; height: 92px; overflow: hidden; border-radius: 18px; background: #eaf3f0; }
.cow-list-photo img { width: 100%; height: 100%; object-fit: cover; }
.cow-list-photo span { display: grid; width: 100%; height: 100%; place-items: center; font-size: 34px; }
.cow-card-content { flex: 1; min-width: 0; }
.cow-table-identity { display: flex; align-items: center; gap: 11px; }
.cow-table-photo { display: grid; flex: 0 0 54px; width: 54px; height: 54px; overflow: hidden; place-items: center; border-radius: 13px; background: #eaf3f0; }
.cow-table-photo img { width: 100%; height: 100%; object-fit: cover; }
.cow-event-timeline { padding: 0 20px 20px; }
.cow-event-item { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--modern-line); }
.cow-event-item:last-child { border-bottom: 0; }
.cow-event-icon { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 13px; background: #e7f8f5; color: var(--modern-teal-dark); font-weight: 900; }
.cow-event-copy > div { display: flex; align-items: center; gap: 8px; }
.cow-event-copy > div span { padding: 3px 7px; border-radius: 6px; background: #f0f2f1; color: #5e6964; font-size: 11px; font-weight: 850; }
.cow-event-copy small { display: block; margin-top: 5px; color: var(--modern-muted); }
.cow-event-copy p { margin: 6px 0 0; color: #4f5a55; }
.event-todo-badge { padding: 5px 8px; border-radius: 8px; background: #fff0dc; color: #a95c00; font-size: 12px; font-weight: 850; }

/* 개체 상세: 긴 스크롤 대신 유지되는 탭과 한눈에 보는 요약 */
.cow-health-status-panel[hidden] { display: none !important; }
.cow-health-status-panel { margin: 0 0 14px; padding: 20px; border-color: #b9dcd2; background: linear-gradient(145deg, #f2faf7, #fff); }
.cow-health-status-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.cow-health-status-heading h2 { margin: 3px 0 4px; font-size: 24px; }
.cow-health-status-heading p { margin: 0; color: #61736a; font-size: 13px; }
.cow-health-close { display: grid; width: 38px; height: 38px; flex: 0 0 38px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: #e5efeb; color: #536a60; font-size: 26px; cursor: pointer; }
.cow-health-status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 15px; }
.cow-health-status-card { display: grid; grid-template-columns: 43px minmax(0, 1fr); align-items: center; gap: 8px 10px; min-height: 125px; padding: 13px; border: 1px solid #c5e0d8; border-radius: 13px; background: #fff; }
.cow-health-status-card > span { display: grid; width: 41px; height: 41px; place-items: center; border-radius: 12px; background: #dff3ec; color: #178263; font-size: 21px; font-weight: 950; }
.cow-health-status-card.danger { border-color: #ecc0bd; background: #fff7f6; }
.cow-health-status-card.danger > span { background: #f9dfdc; color: #b34138; }
.cow-health-status-card.empty { border-color: #dfe5e2; background: #f8faf9; }
.cow-health-status-card.empty > span { background: #e9eeeb; color: #78857e; }
.cow-health-status-card small,
.cow-health-status-card strong,
.cow-health-status-card b,
.cow-health-status-card em { display: block; }
.cow-health-status-card small { color: #66786e; font-size: 12px; font-weight: 900; }
.cow-health-status-card strong { margin-top: 5px; color: #203d30; font-size: 16px; white-space: nowrap; }
.cow-health-status-card b { margin-top: 3px; color: #1b7a60; font-size: 12px; }
.cow-health-status-card.danger b { color: #b34138; }
.cow-health-status-card.empty b { color: #738078; }
.cow-health-status-card em { margin-top: 2px; color: #7b8881; font-size: 10px; font-style: normal; }
.cow-health-manual-open { grid-column: 2; justify-self: start; min-height: 31px; padding: 4px 9px; border: 1px solid #b8d5ca; border-radius: 8px; background: #fff; color: #176d51; font-size: 11px; font-weight: 900; cursor: pointer; }
.cow-health-manual-open:hover { background: #edf8f3; }
.cow-health-manual-dialog { width: min(470px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 18px; background: #fff; color: #263d32; box-shadow: 0 24px 70px rgba(14, 37, 26, .3); }
.cow-health-manual-dialog::backdrop { background: rgba(15, 29, 22, .62); backdrop-filter: blur(3px); }
.cow-health-manual-dialog form { display: grid; gap: 14px; padding: 20px; }
.cow-health-manual-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cow-health-manual-dialog h3 { margin: 3px 0 0; font-size: 23px; }
.cow-health-manual-dialog header > button { display: grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: #eff3f1; color: #52635a; font-size: 25px; cursor: pointer; }
.cow-health-manual-dialog > form > p { margin: 0; padding: 11px 12px; border-radius: 10px; background: #f1f7f4; color: #566a60; font-size: 13px; }
.cow-health-manual-dialog label { display: grid; gap: 6px; color: #40564b; font-size: 14px; font-weight: 900; }
.cow-health-manual-dialog label small { color: #849087; font-weight: 700; }
.cow-health-manual-dialog input,
.cow-health-manual-dialog select { width: 100%; min-height: 49px; padding: 9px 11px; border: 1px solid #ccd8d2; border-radius: 10px; background: #fff; color: #263d32; font-size: 16px; }
.cow-health-manual-dialog footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 3px; }
.pedigree-status-chip { display:inline-flex;align-items:center;min-height:25px;padding:3px 8px;border-radius:999px;font-size:12px;font-weight:900;white-space:nowrap; }
.pedigree-status-chip.ready { background:#e7f6ec;color:#21623d; }
.pedigree-status-chip.due { background:#fff2cc;color:#8a5500; }
.pedigree-status-chip.ignored { background:#edf0ef;color:#56645d; }
.pedigree-notice-toggle { display:inline-flex;margin:0; }
.pedigree-certificate-dialog { width:min(1040px,calc(100vw - 24px));height:min(92vh,920px);padding:0;border:0;border-radius:20px;background:#f7faf8;color:#263d32;box-shadow:0 28px 90px rgba(12,35,24,.38);overflow:hidden; }
.pedigree-certificate-dialog::backdrop { background:rgba(15,29,22,.66);backdrop-filter:blur(3px); }
.pedigree-certificate-dialog[open] { display:grid;grid-template-rows:auto minmax(0,1fr) auto; }
.pedigree-certificate-dialog header { display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:16px 18px;background:#fff;border-bottom:1px solid #d8e1dc; }
.pedigree-certificate-dialog h2 { margin:3px 0;font-size:24px; }
.pedigree-certificate-dialog header small { color:#65776e;font-weight:700; }
.pedigree-certificate-dialog header>button { display:grid;width:44px;height:44px;padding:0;place-items:center;border:0;border-radius:50%;background:#e9efec;color:#263d32;font-size:30px;font-weight:700;cursor:pointer; }
.pedigree-certificate-dialog iframe { width:100%;height:100%;border:0;background:#dfe6e2; }
.pedigree-certificate-dialog footer { display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;background:#fff;border-top:1px solid #d8e1dc; }
@media (max-width: 600px) {
    .pedigree-certificate-dialog { width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0; }
    .pedigree-certificate-dialog header { padding:13px 14px; }
    .pedigree-certificate-dialog h2 { font-size:20px; }
    .pedigree-certificate-dialog footer { display:grid;grid-template-columns:1fr 1fr; }
    .pedigree-certificate-dialog footer .btn { width:100%; }
}
.cow-health-status-card.warning,
.cow-health-status-card.due { border-color: #efd49a; background: #fffaf0; }
.cow-health-status-card.warning > span,
.cow-health-status-card.due > span { background: #fff0c8; color: #9b6500; }
.cow-health-summary-badge { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border-radius: 999px; background: #edf1ef; color: #5d6a63; font-size: 12px; font-weight: 900; }
.cow-health-summary-badge.ok { background: #dff3e9; color: #167150; }
.cow-health-summary-badge.attention { background: #fff0c8; color: #8d5c00; }
.cow-health-summary-badge.danger { background: #f9dfdc; color: #a7352e; }
.cow-health-badges,
.cow-health-cell { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 6px; }
.cow-health-badges { margin-top: 10px; }
.cow-health-chip { display: inline-flex; width: 100%; min-height: 37px; align-items: center; justify-content: flex-start; gap: 5px; padding: 6px 8px; border: 1px solid #d9e0dc; border-radius: 9px; background: #f7f9f8; color: #5e6c65; font: inherit; font-size: 12px; font-weight: 900; line-height: 1.15; text-align: left; white-space: nowrap; cursor: pointer; }
.cow-health-chip > span { display: grid; flex: 0 0 19px; width: 19px; height: 19px; place-items: center; border-radius: 50%; background: rgba(255,255,255,.72); font-size: 11px; }
.cow-health-chip:hover,
.cow-health-chip:focus-visible { filter: brightness(.97); transform: translateY(-1px); }
.cow-health-chip.good { border-color: #9fd5bd; background: #e2f5ec; color: #116f4b; }
.cow-health-chip.warning { border-color: #eccb82; background: #fff2ce; color: #8c5c00; }
.cow-health-chip.danger { border-color: #e8aaa5; background: #fee7e4; color: #a52e28; }
.cow-health-cell { min-width: 248px; max-width: 270px; }
.cow-health-quick-popover { position: fixed; z-index: 1800; display: grid; gap: 5px; padding: 14px 15px; border: 1px solid #cad8d1; border-radius: 13px; background: #fff; color: #30453b; box-shadow: 0 14px 38px rgba(20, 47, 36, .24); }
.cow-health-quick-popover[hidden] { display: none !important; }
.cow-health-quick-popover strong { font-size: 17px; }
.cow-health-quick-popover b { color: #146f50; font-size: 14px; }
.cow-health-quick-popover span { color: #3f544a; font-size: 14px; font-weight: 800; }
.cow-health-quick-popover small { color: #68776f; font-size: 13px; line-height: 1.45; }
.cow-health-loading { grid-column: 1 / -1; min-height: 90px; display: grid; place-items: center; border: 1px dashed #bcd6ce; border-radius: 12px; color: #49695b; font-size: 14px; font-weight: 850; }
.cow-health-loading.error { border-color: #e7bfbb; background: #fff8f7; color: #a8443b; }
.cow-health-source { margin: 11px 1px 0; color: #718078; font-size: 11px; }
.cow-detail-tabs { position: sticky; top: 70px; z-index: 45; display: flex; gap: 5px; margin: 16px 0; padding: 7px; overflow-x: auto; border: 1px solid var(--modern-line); border-radius: 17px; background: rgba(255,255,255,.96); box-shadow: 0 7px 22px rgba(25,47,40,.08); scrollbar-width: none; }
.cow-detail-tabs::-webkit-scrollbar { display: none; }
.cow-detail-tab { flex: 1 0 auto; min-height: 48px; padding: 8px 17px; border: 0; border-radius: 12px; background: transparent; color: #65706b; font-size: 15px; font-weight: 850; cursor: pointer; }
.cow-detail-tab:hover { background: #f2f7f5; }
.cow-detail-tab.active { background: var(--modern-teal); color: #fff; box-shadow: 0 5px 14px rgba(23,184,170,.2); }
.cow-detail-tab b, .cow-detail-tab small { display: inline-grid; min-width: 20px; height: 20px; margin-left: 4px; place-items: center; border-radius: 999px; background: rgba(0,0,0,.08); font-size: 11px; }
.cow-detail-tab b { background: #ffede9; color: #d74d42; }
.cow-detail-tab.active b, .cow-detail-tab.active small { background: rgba(255,255,255,.22); color: #fff; }
.cow-tab-panel[hidden] { display: none !important; }
.cow-tab-panel.active { animation: cow-tab-in .16s ease-out; }
@keyframes cow-tab-in { from { opacity: .2; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.cow-summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 13px; }
.cow-summary-strip button { display: grid; min-height: 115px; padding: 16px; border: 1px solid var(--modern-line); border-radius: 17px; background: #fff; color: var(--modern-ink); text-align: left; cursor: pointer; }
.cow-summary-strip button:hover:not(:disabled) { border-color: #9bd9d1; background: #f7fdfc; transform: translateY(-1px); }
.cow-summary-strip button:disabled { cursor: default; }
.cow-summary-strip span { color: var(--modern-muted); font-size: 12px; font-weight: 850; }
.cow-summary-strip strong { align-self: end; margin-top: 10px; font-size: 21px; }
.cow-summary-strip small { margin-top: 5px; overflow: hidden; color: var(--modern-muted); text-overflow: ellipsis; white-space: nowrap; }
.cow-summary-strip .state-임신중 { color: #e4475b; }
.cow-summary-strip .state-공태 { color: #2780d6; }
.cow-summary-strip .state-비육 { color: #b36e05; }
.breeding-overview-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--modern-line); }
.breeding-overview-chips span { padding: 8px 11px; border-radius: 10px; background: #f1f5f3; color: #5b6661; font-size: 13px; }
.breeding-overview-chips b { margin-right: 3px; color: var(--modern-ink); }
.breeding-overview-chips .important { background: #fff0ee; color: #c94c58; }
.older-breeding-record { display: none; }
.older-breeding-record.is-visible { display: block; }
.show-older-breeding { width: calc(100% - 28px); min-height: 48px; margin: 10px 14px 16px; border: 1px solid #cfe1db; border-radius: 12px; background: #f4f9f7; color: #24766e; font-weight: 850; cursor: pointer; }

/* 목록에서 상태와 최근 기록을 바로 읽는 행 */
.cow-state-chip { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; border-radius: 8px; background: #edf1ef; color: #55605b; font-size: 12px; font-weight: 900; }
.cow-state-chip.state-임신중 { background: #ffeaed; color: #d74658; }
.cow-state-chip.state-공태 { background: #e8f3ff; color: #2879c8; }
.cow-state-chip.state-비육 { background: #fff1d6; color: #a66505; }
.cow-state-chip.state-출하, .cow-state-chip.state-도축 { background: #eee9ff; color: #684fbd; }
.cow-state-chip.state-폐사 { background: #eee; color: #686868; }
.cow-latest-event { margin: 7px 0 0; overflow: hidden; color: #55605b; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.cow-latest-event span { margin-right: 5px; padding: 3px 6px; border-radius: 6px; background: #e8f7f4; color: #178478; font-weight: 850; }
.cow-latest-event small { color: #8a928e; }
.cow-record-type-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.cow-record-type-chips span { padding: 4px 7px; border-radius: 7px; background: #edf5f3; color: #347169; font-size: 11px; font-weight: 850; }
.cow-record-type-chips.table-chips { margin-top: 6px; }
.cow-pending-work, .table-pending-work { display: inline-flex; margin: 6px 0 0; padding: 4px 7px; border-radius: 7px; background: #fff0db; color: #a66106; font-size: 11px; font-weight: 900; }
.table-latest-event { display: block; max-width: 360px; margin-top: 6px; overflow: hidden; color: #75807a; text-overflow: ellipsis; white-space: nowrap; }
.table-latest-event b { color: #14877b; }
.clickable-cow-row { cursor: pointer; transition: background .12s ease, box-shadow .12s ease; }
.clickable-cow-row:hover, .clickable-cow-row:focus { outline: none; background: #f3fbf9; box-shadow: inset 4px 0 var(--modern-teal); }
.cow-row-actions { min-width: 84px; }

/* 기록 종류마다 달라지는 입력 보조 */
.record-choice-presets { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.record-choice-presets:empty { display: none; }
.record-choice-presets button { min-height: 36px; padding: 6px 11px; border: 1px solid #cfe0db; border-radius: 999px; background: #f5faf8; color: #28736c; font-weight: 800; cursor: pointer; }
.record-choice-presets button:hover { border-color: var(--modern-teal); background: #e9f9f6; }

/* 출산 기록에서 기존 송아지 연결 또는 새 등록 */
.linked-calf-card { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; padding: 16px; border: 1px solid #a9dfd7; border-radius: 14px; background: #effbf8; }
.linked-calf-card span { color: #68736e; font-size: 12px; font-weight: 800; }
.linked-calf-card strong { font-size: 17px; }
.linked-calf-card a { margin-left: auto; color: var(--modern-teal-dark); font-weight: 850; text-decoration: none; }
.calf-candidate-fieldset { margin: 0 0 16px; padding: 14px; border: 1px solid var(--modern-line); border-radius: 14px; }
.calf-candidate-fieldset legend { padding: 0 6px; font-weight: 850; }
.calf-candidate-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.calf-candidate-list label { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #e1e7e4; border-radius: 12px; cursor: pointer; }
.calf-candidate-list label:has(input:checked) { border-color: var(--modern-teal); background: #edf9f7; }
.calf-candidate-list input { width: 21px; height: 21px; accent-color: var(--modern-teal); }
.calf-candidate-list span { display: grid; gap: 3px; }
.calf-candidate-list small { color: var(--modern-muted); }
.clear-radio-button { margin-top: 9px; border: 0; background: transparent; color: #6a7570; text-decoration: underline; cursor: pointer; }
.new-calf-details { margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--modern-line); border-radius: 14px; background: #f8faf9; }
.new-calf-details summary { font-weight: 900; cursor: pointer; }
.new-calf-details > p { margin: 7px 0 14px; color: var(--modern-muted); font-size: 13px; }

/* 대시보드 축사 배치도: CCTV와 동일하게 왼쪽 동쪽, 오른쪽 서쪽 */
.barn-map-card { position: relative; margin: 22px 0; padding: 20px; overflow: visible; }
.barn-map-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.barn-map-header h2 { margin: 3px 0 4px; font-size: 25px; letter-spacing: -.03em; }
.barn-map-header p { margin: 0; color: var(--modern-muted); font-size: 14px; }
.barn-header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 12px; }
.barn-edit-button, .barn-move-button { min-height: 38px; padding: 0 13px; border: 1px solid #cfe1db; border-radius: 10px; background: #f4faf8; color: var(--modern-teal-dark); font: inherit; font-size: 13px; font-weight: 900; cursor: pointer; }
.barn-move-button { border-color: var(--modern-teal); background: var(--modern-teal); color: #fff; }
.barn-edit-button:hover { border-color: var(--modern-teal); background: #eaf9f6; }
.barn-move-button:hover { background: var(--modern-teal-dark); }
.barn-manage-link { flex: 0 0 auto; padding: 8px 0; color: var(--modern-teal-dark); font-weight: 900; text-decoration: none; }
.barn-map-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 13px; margin: 16px 0 12px; color: #606b66; font-size: 13px; }
.barn-map-summary > strong { color: var(--modern-ink); }
.barn-map-legend { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 5px; margin-left: auto; }
.barn-map-legend i { width: 10px; height: 10px; margin-left: 5px; border-radius: 50%; background: #96a19b; }
.barn-map-legend i.calving-soon { background: #df5d50; }
.barn-map-legend i.pregnant { background: #4b9b67; }
.barn-map-legend i.checking { background: #d99a2d; }
.barn-map-legend i.open { background: #89948e; }
.barn-map-legend i.male { background: #76a9df; }
.barn-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 5px; border-radius: 13px; background: #f0f4f2; }
.barn-tab { min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: #65706b; font: inherit; font-size: 14px; font-weight: 900; cursor: pointer; }
.barn-tab b { display: inline-grid; min-width: 22px; height: 22px; margin-left: 5px; place-items: center; border-radius: 999px; background: rgba(0,0,0,.07); font-size: 11px; }
.barn-tab.active { background: #fff; color: var(--modern-teal-dark); box-shadow: 0 3px 10px rgba(26, 49, 41, .08); }
.barn-tab.active b { background: #ddf7f3; }
.barn-panel { margin-top: 10px; }
.barn-orientation { display: grid; grid-template-columns: 90px minmax(0, 1fr) 74px minmax(0, 1fr) 90px; align-items: center; gap: 6px; padding: 0 3px 7px; color: #52605a; font-size: 14px; font-weight: 850; text-align: center; }
.barn-orientation .calf-aisle-direction { color: #9a641d; font-size: 12px; }
.barn-orientation span { font-size: 12px; font-weight: 900; }
.barn-floor { display: grid; grid-template-columns: 90px minmax(0, 1fr) 74px minmax(0, 1fr) 90px; align-items: stretch; gap: 6px; }
.barn-side-column { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.barn-pen { display: grid; min-height: 66px; min-width: 0; align-content: center; gap: 7px; padding: 9px 11px; border: 1px solid #dce7e2; background: #f7faf8; }
.barn-pen.east { border-radius: 11px 4px 4px 11px; }
.barn-pen.west { border-radius: 4px 11px 11px 4px; }
.barn-pen-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #3f5048; font-size: 14px; }
.barn-pen-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barn-pen-heading b { display: grid; flex: 0 0 25px; height: 25px; place-items: center; border-radius: 999px; background: #e2ebe7; color: #52615a; font-size: 12px; }
.barn-cow-cluster { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; flex-wrap: wrap; gap: 4px; }
.barn-pen.east .barn-cow-cluster { justify-content: flex-end; }
.barn-pen.west .barn-cow-cluster { justify-content: flex-start; }
.barn-cow-marker { position: relative; display: grid; width: 56px; height: 56px; padding: 0; place-items: center; border: 3px solid #fff; border-radius: 15px; background: #f9d9de; font-size: 35px; line-height: 1; box-shadow: 0 2px 7px rgba(32, 55, 47, .12); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.barn-cow-marker.male { background: #d6e9fa; }
.barn-cow-marker.repro-calving-soon { border-color: #df5d50; background: #fee4df; }
.barn-cow-marker.repro-pregnant { border-color: #4b9b67; background: #e4f4e8; }
.barn-cow-marker.repro-checking { border-color: #d99a2d; background: #fff1cf; }
.barn-cow-marker.repro-open { border-color: #89948e; background: #eef1ef; }
.barn-reproduction-badge { position: absolute; top: -7px; right: -7px; display: grid; width: 24px; height: 24px; place-items: center; border: 2px solid #fff; border-radius: 50%; background: #89948e; color: #fff; font-size: 12px; font-style: normal; font-weight: 950; line-height: 1; box-shadow: 0 1px 4px rgba(26, 49, 41, .18); }
.repro-calving-soon .barn-reproduction-badge { background: #d64f43; }
.repro-pregnant .barn-reproduction-badge { background: #3e8c5a; }
.repro-checking .barn-reproduction-badge { background: #c58416; }
.barn-cow-marker:hover, .barn-cow-marker:focus-visible, .barn-cow-marker.active { z-index: 2; outline: 3px solid rgba(23, 184, 170, .28); transform: translateY(-2px) scale(1.05); box-shadow: 0 5px 12px rgba(32, 55, 47, .18); }
.barn-map-card.moving .barn-edit-button, .barn-map-card.moving .barn-move-button { display: none; }
.barn-map-card.moving [data-drop-zone] { cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.barn-map-card.moving .barn-pen, .barn-map-card.moving .barn-calf-aisle { border-style: dashed; border-color: #59b9ad; background: #e8faf6; }
.barn-map-card.moving .barn-cow-marker { cursor: grab; touch-action: none; animation: barn-cow-ready .8s ease-in-out infinite alternate; }
.barn-map-card.moving .barn-cow-marker:active { cursor: grabbing; }
.barn-map-card.moving .barn-cow-marker.move-selected { outline: 3px solid var(--modern-teal); transform: translateY(-3px) scale(1.08); animation: none; }
.barn-map-card.moving [data-drop-zone].drag-over { border-color: var(--modern-teal); background: #dcf7f2; box-shadow: inset 0 0 0 2px rgba(23, 184, 170, .25); }
@keyframes barn-cow-ready { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }
.barn-central-aisle { display: flex; min-height: 100%; align-items: center; justify-content: center; border-radius: 5px; background: repeating-linear-gradient(135deg, #edf1ef, #edf1ef 8px, #f6f8f7 8px, #f6f8f7 16px); color: #78827d; }
.barn-central-aisle span { writing-mode: vertical-rl; font-size: 14px; font-weight: 950; letter-spacing: .16em; }
.barn-calf-aisle { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 9px; padding: 10px 7px; border: 2px solid #e7c788; background: repeating-linear-gradient(135deg, #fff8e9, #fff8e9 10px, #fffdf6 10px, #fffdf6 20px); }
.barn-calf-aisle.east { border-radius: 14px 5px 5px 14px; }
.barn-calf-aisle.west { border-radius: 5px 14px 14px 5px; }
.barn-calf-aisle-heading { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 3px; color: #805515; text-align: center; }
.barn-calf-aisle-heading strong { font-size: 14px; line-height: 1.18; }
.barn-calf-aisle-heading b { display: grid; flex: 0 0 25px; height: 25px; place-items: center; border-radius: 999px; background: #f2d79f; color: #70470b; font-size: 12px; }
.barn-calf-aisle .barn-cow-cluster { align-content: flex-start; justify-content: center; }
.barn-map-card.editing .barn-map-summary, .barn-map-card.editing .barn-map-view, .barn-map-card.editing .barn-unplaced, .barn-map-card.editing .barn-edit-button { display: none; }
.barn-layout-editor { padding: 5px 0 0; }
.barn-layout-editor[hidden], .barn-editor-savebar[hidden] { display: none !important; }
.barn-editor-intro { padding: 13px 14px; border-radius: 12px; background: #eef8f5; }
.barn-editor-intro strong { font-size: 16px; }
.barn-editor-intro p { margin: 4px 0 0; color: #64706b; font-size: 12px; }
.barn-editor-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.barn-editor-side { padding: 12px; border: 1px solid var(--modern-line); border-radius: 12px; }
.barn-editor-side h3 { margin: 0 0 9px; font-size: 14px; }
.barn-editor-side h3 small { margin-left: 4px; color: var(--modern-muted); font-size: 10px; }
.barn-editor-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.barn-editor-group { display: grid; min-width: 46px; min-height: 44px; padding: 5px 9px; place-items: center; border: 1px solid #d6e1dc; border-radius: 9px; background: #fff; color: #3e4b45; font: inherit; font-size: 13px; font-weight: 900; cursor: pointer; }
.barn-editor-group small { color: #8a948f; font-size: 8px; font-weight: 750; }
.barn-editor-group.merged { border-color: #8fd2c9; background: #eefaf7; color: #087d75; }
.barn-editor-group.selected { border-color: var(--modern-teal); outline: 3px solid rgba(23, 184, 170, .2); background: #dff7f3; }
.barn-editor-tools { display: grid; grid-template-columns: auto auto minmax(10px, 1fr) auto auto; align-items: center; gap: 7px; margin-top: 10px; }
.barn-editor-tools .btn { min-height: 39px; }
.barn-text-button { border: 0; background: transparent; color: #68736e; font: inherit; font-size: 12px; font-weight: 850; text-decoration: underline; cursor: pointer; }
.barn-editor-savebar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; margin-top: 12px; padding: 11px 12px; border: 1px solid #cde3dd; border-radius: 12px; background: #f0faf7; }
.barn-editor-savebar span { color: #56625d; font-size: 12px; font-weight: 800; }
.barn-editor-savebar span.error { color: #c8423a; }
.barn-editor-savebar .btn { min-height: 41px; }
.barn-move-savebar { position: sticky; bottom: 10px; z-index: 100; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; margin-top: 12px; padding: 11px 12px; border: 1px solid #83cfc5; border-radius: 13px; background: rgba(239, 252, 249, .97); box-shadow: 0 8px 25px rgba(22, 80, 67, .14); backdrop-filter: blur(9px); }
.barn-move-savebar[hidden] { display: none !important; }
.barn-move-savebar > div { display: grid; gap: 2px; }
.barn-move-savebar strong { color: #087d75; }
.barn-move-savebar small { color: #5f6c66; font-size: 11px; }
.barn-move-savebar small.error { color: #c8423a; }
.barn-move-savebar .btn { min-height: 42px; }
.barn-unplaced { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; margin-top: 10px; padding: 9px 11px; border: 1px dashed #d9e2de; border-radius: 11px; background: #fafcfb; }
.barn-unplaced.warning { border-color: #efc77e; background: #fffaf0; }
.barn-unplaced-label { display: grid; gap: 1px; min-width: 82px; font-size: 12px; }
.barn-unplaced-label small { color: var(--modern-muted); }
.barn-unplaced-cows { display: flex; gap: 4px; padding: 2px; overflow-x: auto; }
.barn-unplaced .barn-cow-marker { flex: 0 0 48px; width: 48px; height: 48px; font-size: 29px; }
.barn-cow-popover { position: absolute; z-index: 120; width: 300px; padding: 17px; border: 1px solid #dce5e1; border-radius: 16px; background: #fff; box-shadow: 0 14px 38px rgba(23, 45, 37, .2); }
.barn-cow-popover[hidden] { display: none !important; }
.barn-popover-close { position: absolute; top: 8px; right: 9px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #f1f4f2; color: #57625d; font-size: 23px; line-height: 1; cursor: pointer; }
.barn-popover-location { display: block; padding-right: 30px; color: var(--modern-teal-dark); font-size: 12px; font-weight: 850; }
.barn-cow-popover h3 { margin: 5px 0 12px; font-size: 21px; letter-spacing: .02em; }
.barn-cow-popover dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin: 0 0 12px; }
.barn-cow-popover dl div { padding: 9px; border-radius: 10px; background: #f5f8f6; }
.barn-cow-popover dt { color: var(--modern-muted); font-size: 11px; font-weight: 800; }
.barn-cow-popover dd { margin: 2px 0 0; color: var(--modern-ink); font-size: 15px; font-weight: 900; }
.barn-detail-button { display: flex; min-height: 42px; align-items: center; justify-content: center; text-decoration: none; }

@media (max-width: 1100px) {
    .modern-today-grid { grid-template-columns: repeat(2, 1fr); }
    .record-type-launcher { grid-template-columns: repeat(4, 1fr); }
    .records-filter-form { grid-template-columns: repeat(2, 1fr); }
    .records-filter-form .btn { min-height: 48px; }
    .modern-event-row { grid-template-columns: 48px minmax(120px, .7fr) 1.5fr auto; }
    .event-actions { grid-column: 2 / -1; justify-content: flex-end; }
    .inventory-layout { grid-template-columns: 1fr; }
    .cow-profile-hero { grid-template-columns: auto 1fr; }
    .cow-profile-summary { grid-column: 1 / -1; }
    .cow-summary-strip { grid-template-columns: repeat(2, 1fr); }
    .cow-health-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .app-main { width: 100%; padding-right: 17px; padding-left: 17px; }
    .app-topbar { min-height: 62px; }
    .mobile-bottom-nav { border-top-color: var(--modern-line); border-radius: 24px 24px 0 0; background: rgba(255,255,255,.97); box-shadow: 0 -8px 28px rgba(26, 49, 41, .08); }
    .mobile-bottom-nav a.active { color: var(--modern-teal-dark); }
    .global-record-fab { position: fixed; right: 18px; bottom: calc(83px + env(safe-area-inset-bottom)); z-index: 380; display: flex; align-items: center; gap: 6px; padding: 12px 17px; border-radius: 999px; background: var(--modern-teal); color: #fff; font-size: 15px; font-weight: 900; text-decoration: none; box-shadow: 0 10px 25px rgba(9, 143, 134, .28); }
    .global-record-fab span { font-size: 21px; line-height: 1; }
    .barn-map-card { margin: 17px -5px; padding: 15px; border-radius: 17px; }
    .barn-map-header { gap: 8px; }
    .barn-map-header h2 { font-size: 22px; }
    .barn-map-header p { max-width: 230px; font-size: 12px; }
    .barn-header-actions { flex-direction: column; align-items: flex-end; gap: 2px; }
    .barn-edit-button, .barn-move-button { min-height: 34px; padding: 0 9px; font-size: 11px; }
    .barn-manage-link { font-size: 13px; }
    .barn-map-summary { margin: 12px 0 10px; gap: 5px 10px; font-size: 11px; }
    .barn-map-legend { width: 100%; margin-left: 0; }
    .barn-tab { min-height: 39px; font-size: 13px; }
    .barn-orientation, .barn-floor { grid-template-columns: 50px minmax(0, 1fr) 40px minmax(0, 1fr) 50px; gap: 3px; }
    .barn-orientation { padding-right: 0; padding-left: 0; font-size: 11px; }
    .barn-orientation .calf-aisle-direction { font-size: 9px; line-height: 1.1; }
    .barn-orientation span { font-size: 10px; }
    .barn-side-column { gap: 3px; }
    .barn-pen { min-height: 61px; gap: 4px; padding: 6px; }
    .barn-pen-heading { font-size: 11px; }
    .barn-pen-heading b { flex-basis: 21px; height: 21px; font-size: 10px; }
    .barn-cow-cluster { gap: 2px; }
    .barn-cow-marker { width: 47px; height: 47px; border-radius: 12px; font-size: 29px; }
    .barn-central-aisle span { font-size: 11px; }
    .barn-calf-aisle { gap: 6px; padding: 7px 3px; }
    .barn-calf-aisle-heading { flex-direction: column; justify-content: flex-start; }
    .barn-calf-aisle-heading strong { font-size: 11px; }
    .barn-calf-aisle-heading b { flex-basis: 21px; width: 21px; height: 21px; font-size: 10px; }
    .barn-calf-aisle .barn-cow-marker { width: 43px; height: 43px; font-size: 26px; }
    .barn-editor-sides { grid-template-columns: 1fr; gap: 7px; }
    .barn-editor-side { padding: 10px; }
    .barn-editor-group { min-width: 42px; min-height: 41px; }
    .barn-editor-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .barn-editor-tools > span { display: none; }
    .barn-text-button { min-height: 34px; }
    .barn-editor-savebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .barn-editor-savebar span { grid-column: 1 / -1; }
    .barn-move-savebar { position: fixed; right: 10px; bottom: calc(82px + env(safe-area-inset-bottom)); left: 10px; z-index: 410; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .barn-move-savebar > div { grid-column: 1 / -1; }
    .barn-map-card.moving { padding-bottom: 90px; }
    .barn-unplaced { grid-template-columns: 1fr; gap: 6px; padding: 8px; }
    .barn-unplaced-label { display: flex; align-items: center; justify-content: space-between; }
    .barn-cow-popover { position: fixed; right: 12px; bottom: calc(88px + env(safe-area-inset-bottom)); left: 12px !important; top: auto !important; z-index: 420; width: auto; }
    .dashboard-hero { padding: 5px 0 12px; }
    .dashboard-hero h1 { font-size: 28px; }
    .modern-today-board { margin-right: -5px; margin-left: -5px; padding: 17px; border-radius: 20px; }
    .modern-today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .today-color-card { min-height: 112px; padding: 15px; border-radius: 18px; }
    .today-color-card strong { font-size: 32px; }
    .modern-home-shortcuts { grid-template-columns: repeat(4, 1fr); gap: 2px; }
    .modern-home-shortcuts a { flex-direction: column; gap: 4px; min-height: 67px; font-size: 12px; }
    .record-type-launcher { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .record-type-button { min-height: 100px; border-radius: 17px; }
    .record-type-button > span { width: 44px; height: 44px; border-radius: 14px; }
    .record-type-button strong { font-size: 13px; }
    .records-filter-form { grid-template-columns: 1fr; }
    .modern-event-row { grid-template-columns: 45px 1fr auto; gap: 10px; }
    .event-cow { grid-column: 2; }
    .event-main { grid-column: 2 / -1; }
    .event-due { grid-column: 3; grid-row: 1 / 3; }
    .event-actions { grid-column: 2 / -1; }
    .inventory-grid { grid-template-columns: repeat(2, 1fr); }
    .ledger-page-header { align-items: flex-start; }
    .ledger-page-header .header-actions { flex-wrap: wrap; justify-content: flex-end; }
    .ledger-page-header .header-actions .btn { min-height: 40px; padding: 8px 10px; font-size: 11px; }
    .ledger-quick-guide { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 11px; }
    .ledger-quick-guide i { display: none; }
    .ledger-quick-guide div { padding: 9px; border-radius: 10px; background: rgba(255,255,255,.8); }
    .ledger-section-heading { align-items: flex-start; }
    .ledger-section-heading h2 { font-size: 20px; }
    .ledger-section-heading p { max-width: 230px; }
    .ledger-stock-grid { grid-template-columns: 1fr; }
    .ledger-stock-card { padding: 15px; }
    .ledger-stock-empty { grid-template-columns: auto 1fr; padding: 15px; }
    .ledger-stock-empty > .btn { grid-column: 1 / -1; }
    .ledger-entry-form { margin-right: -5px; margin-left: -5px; padding: 15px; }
    .ledger-kind-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .ledger-kind-option { min-height: 94px; padding: 9px; }
    .ledger-form-grid { grid-template-columns: 1fr; gap: 9px; }
    .ledger-value-block { grid-template-columns: 1fr; gap: 10px; padding: 13px; }
    .ledger-quantity-fields { grid-template-columns: 1fr 105px; }
    .ledger-save-bar { position: fixed; right: 10px; bottom: calc(82px + env(safe-area-inset-bottom)); left: 10px; z-index: 410; grid-template-columns: 1fr auto; }
    .ledger-save-bar > span { grid-column: 1 / -1; }
    .ledger-entry-form { padding-bottom: 105px; }
    .ledger-summary-stock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-hero-grid { grid-template-columns: repeat(2, 1fr); }
    .statistics-grid { grid-template-columns: 1fr; }
    .farm-stat-tabs { top: 64px; display: flex; margin-right: -8px; margin-left: -8px; padding: 5px; overflow-x: auto; border-radius: 14px; scrollbar-width: none; }
    .farm-stat-tabs::-webkit-scrollbar { display: none; }
    .farm-stat-tabs button { flex: 0 0 auto; min-height: 43px; padding: 7px 11px; font-size: 11px; }
    .farm-stat-tabs button span { width: 22px; height: 22px; font-size: 12px; }
    .farm-stat-intro { min-height: 102px; align-items: flex-start; margin-right: -5px; margin-left: -5px; padding: 17px; }
    .farm-stat-intro h2 { font-size: 21px; }
    .farm-stat-intro p { max-width: 245px; font-size: 10px; }
    .farm-stat-intro > a, .farm-stat-intro-actions a { font-size: 10px; }
    .farm-stat-intro-actions { align-items: flex-end; flex-direction: column; gap: 5px; }
    .analytics-kpi-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .analytics-kpi { min-height: 99px; padding: 13px; }
    .analytics-kpi strong { font-size: 23px; }
    .analytics-card { margin-right: -5px; margin-left: -5px; padding: 15px; }
    .analytics-two-column { grid-template-columns: 1fr; gap: 9px; }
    .analytics-heading { margin-bottom: 12px; }
    .analytics-heading h3 { font-size: 17px; }
    .analytics-insight { align-items: flex-start; padding: 13px; }
    .analytics-insight > span { flex-basis: 34px; height: 34px; }
    .ledger-month-chart { gap: 3px; height: 174px; }
    .ledger-bars { height: 132px; gap: 1px; }
    .ledger-month strong { font-size: 8px; }
    .analytics-empty-state { min-height: 430px; padding: 25px 15px; }
    .analytics-empty-preview { grid-template-columns: 1fr; margin: 17px 0; }
    .analytics-empty-preview div { min-height: 80px; }
    .breeding-month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .breeding-month-card { min-height: 140px; padding: 11px; }
    .breeding-month-card > b { font-size: 24px; }
    .category-rank-list > div { grid-template-columns: minmax(90px, 1fr) 1.5fr auto; }
    .open-days-distribution > div { grid-template-columns: 92px minmax(70px, 1fr) auto; }
    .slaughter-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .slaughter-analysis { margin-right: -5px; margin-left: -5px; padding: 15px; }
    .slaughter-analysis-header { gap: 8px; }
    .slaughter-analysis-header h2 { font-size: 23px; }
    .slaughter-analysis-header p { max-width: 240px; font-size: 11px; }
    .slaughter-sales-link { font-size: 11px; }
    .slaughter-filter-row { display: grid; gap: 6px; margin-top: 13px; }
    .slaughter-period-tabs, .slaughter-cohort-tabs { display: flex; width: 100%; overflow-x: auto; }
    .slaughter-period-tabs a, .slaughter-cohort-tabs a { flex: 1 0 auto; min-width: 62px; padding: 7px 9px; font-size: 11px; }
    .slaughter-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .slaughter-kpi { min-height: 97px; padding: 12px; }
    .slaughter-kpi span { font-size: 11px; }
    .slaughter-kpi strong { font-size: 23px; }
    .slaughter-assessment { align-items: flex-start; padding: 13px; }
    .assessment-icon { flex-basis: 37px; height: 37px; }
    .slaughter-assessment strong { font-size: 14px; }
    .slaughter-comparison-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .slaughter-comparison { min-height: 81px; padding: 10px; }
    .slaughter-coverage { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .slaughter-coverage > div { grid-column: 1 / -1; }
    .slaughter-detail-tabs { margin-right: -6px; margin-left: -6px; padding: 4px; }
    .slaughter-detail-tabs button { min-height: 39px; padding: 6px 11px; font-size: 11px; }
    .slaughter-distribution-grid { grid-template-columns: 1fr; gap: 10px; }
    .slaughter-distribution-grid > section { padding: 12px; }
    .slaughter-table th, .slaughter-table td { padding: 10px; }
    .slaughter-table-scroll { margin-right: -2px; margin-left: -2px; }
    .cow-profile-hero { grid-template-columns: 90px 1fr; padding: 18px; }
    .cow-profile-photo { width: 88px; height: 88px; border-radius: 19px; }
    .cow-profile-identity h1 { font-size: 25px; }
    .cow-profile-summary { grid-template-columns: repeat(3, 1fr); }
    .cow-list-photo { flex-basis: 78px; width: 78px; height: 78px; border-radius: 15px; }
    .cow-card-main { align-items: flex-start; flex-direction: row; gap: 12px; }
    .cow-detail-tabs { top: 62px; margin-right: -8px; margin-left: -8px; border-radius: 13px; }
    .cow-detail-tab { min-height: 45px; padding: 7px 13px; font-size: 13px; }
    .cow-summary-strip { gap: 8px; }
    .cow-summary-strip button { min-height: 105px; padding: 13px; }
    .cow-summary-strip strong { font-size: 18px; }
    .cow-health-status-panel { padding: 15px; }
    .cow-health-status-heading h2 { font-size: 21px; }
    .cow-health-status-grid { grid-template-columns: 1fr; }
    .cow-health-status-card { min-height: 92px; }
    .cow-health-status-card strong { white-space: normal; }
    .cow-health-chip { font-size: 12px; }
    .calf-candidate-list { grid-template-columns: 1fr; }
    .linked-calf-card { align-items: flex-start; flex-direction: column; }
    .linked-calf-card a { margin-left: 0; }
}

@media (max-width: 430px) {
    .record-type-launcher { grid-template-columns: repeat(3, 1fr); }
    .inventory-grid { grid-template-columns: 1fr; }
    .modern-event-row { padding: 12px; }
    .stats-hero-grid { gap: 8px; }
    .modern-stat-card { min-height: 102px; padding: 15px; }
    .stat-bar-row { grid-template-columns: 90px 1fr auto; }
    .ledger-quantity-fields { grid-template-columns: minmax(0, 1fr) 92px; }
    .ledger-stock-card dl { gap: 5px; }
    .ledger-summary-stock-grid { grid-template-columns: 1fr; }
    .farm-stat-intro { display: grid; }
    .farm-stat-intro-actions { align-items: flex-start; flex-direction: row; }
    .breeding-month-card header { align-items: flex-start; flex-direction: column; }
    .compact-stat-table > div { font-size: 10px; }
}

/* Home: 핵심 현황과 오늘 할 일 중심의 간결한 첫 화면 */
.home-command {
    display: grid;
    grid-template-columns: minmax(250px, .9fr) minmax(320px, 1.25fr) auto;
    align-items: center;
    gap: 18px;
    margin-bottom: 14px;
    padding: 18px 20px;
    border: 1px solid #dbe6e0;
    border-radius: 18px;
    background: linear-gradient(135deg, #f6fbf8 0%, #fff 72%);
    box-shadow: 0 5px 18px rgba(36, 78, 59, .06);
}
.home-command-copy .eyebrow { margin-bottom: 2px; color: #668073; font-size: 11px; letter-spacing: .02em; }
.home-command-copy h1 { margin: 0; color: #173f2e; font-size: clamp(27px, 2.5vw, 35px); line-height: 1; letter-spacing: -.035em; }
.home-command-copy p { margin: 6px 0 0; color: #65766d; font-size: 13px; line-height: 1.45; word-break: keep-all; }
.home-command-search {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    min-width: 0;
    min-height: 48px;
    padding-left: 12px;
    border: 1px solid #cbdad2;
    border-radius: 13px;
    background: #fff;
    overflow: hidden;
}
.home-command-search > span { color: #39745a; font-size: 22px; font-weight: 900; }
.home-command-search input { width: 100%; min-width: 0; height: 46px; padding: 0 8px; border: 0; background: transparent; font-size: 14px; outline: 0; }
.home-command-search button { align-self: stretch; min-width: 64px; border: 0; background: #285f48; color: #fff; font: inherit; font-size: 13px; font-weight: 900; cursor: pointer; }
.home-command-search:focus-within { border-color: #4b8b6d; box-shadow: 0 0 0 3px rgba(56, 128, 92, .12); }
.home-add-cow { min-height: 48px; white-space: nowrap; }

.home-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.home-kpi {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 104px;
    align-content: center;
    padding: 14px 16px 14px 19px;
    border: 1px solid #dfe7e3;
    border-radius: 15px;
    background: #fff;
    color: #23372e;
    text-decoration: none;
    overflow: hidden;
}
.home-kpi::before { position: absolute; inset: 0 auto 0 0; width: 5px; background: #4f8d70; content: ''; }
.home-kpi.birth::before { background: #cf6c64; }
.home-kpi.task::before { background: #5489ad; }
.home-kpi.alert::before { background: #cf9131; }
.home-kpi > span { color: #69786f; font-size: 12px; font-weight: 900; }
.home-kpi strong { margin-top: 4px; color: #183f2e; font-size: 29px; line-height: 1; letter-spacing: -.03em; }
.home-kpi strong small { margin-left: 3px; color: #6e7b74; font-size: 11px; }
.home-kpi em { margin-top: 6px; color: #7a8780; font-size: 10px; font-style: normal; font-weight: 750; white-space: nowrap; }
.home-kpi:hover { border-color: #93b4a3; color: #23372e; box-shadow: 0 6px 18px rgba(31, 78, 57, .08); transform: translateY(-1px); }

.home-weather-alert { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-bottom: 14px; padding: 11px 15px; border: 1px solid #e6b569; border-radius: 12px; background: #fff8e9; color: #754b0d; font-size: 12px; }
.home-weather-alert strong { padding: 3px 7px; border-radius: 7px; background: #b8670a; color: #fff; font-size: 10px; }
.home-weather-alert small { color: #8b6c3d; }

.home-workspace { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .8fr); align-items: start; gap: 14px; margin-bottom: 14px; }
.home-action-panel,
.home-environment,
.home-quick-panel { border: 1px solid #dfe7e3; border-radius: 17px; background: #fff; box-shadow: 0 4px 15px rgba(35, 69, 53, .045); }
.home-action-panel { min-width: 0; overflow: hidden; scroll-margin-top: 90px; }
.home-section-heading { display: flex; min-height: 69px; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 17px; border-bottom: 1px solid #e8eeeb; }
.home-section-heading .eyebrow { margin: 0 0 1px; color: #708078; font-size: 10px; letter-spacing: .03em; }
.home-section-heading h2 { margin: 0; color: #203c2f; font-size: 20px; letter-spacing: -.025em; }
.home-section-heading > a { flex: 0 0 auto; color: #286148; font-size: 12px; font-weight: 900; text-decoration: none; }
.home-action-list { display: grid; }
.home-action-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-width: 0; min-height: 76px; padding: 10px 15px; border-bottom: 1px solid #edf1ef; color: #263a30; text-decoration: none; }
.home-action-row:last-child { border-bottom: 0; }
.home-action-row:hover { background: #f8fbf9; color: #263a30; }
.home-action-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 13px; background: #edf5f0; color: #337052; font-size: 23px; font-weight: 950; }
.home-action-row.urgent .home-action-icon { background: #fbe9e7; color: #ad443b; }
.home-action-row.warning .home-action-icon { background: #fff0d8; color: #a3630e; }
.home-action-row.info .home-action-icon { background: #e8f2f8; color: #316d95; }
.home-action-row > span:nth-child(2) { min-width: 0; }
.home-action-row strong,
.home-action-row small { display: block; min-width: 0; }
.home-action-row strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.home-action-row small { overflow: hidden; margin-top: 2px; color: #748078; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.home-action-row > b { color: #357157; font-size: 11px; white-space: nowrap; }
.home-more-actions { border-top: 1px solid #e7ece9; }
.home-more-actions > summary { padding: 11px 15px; background: #f6f9f7; color: #52675c; font-size: 12px; font-weight: 900; text-align: center; cursor: pointer; }
.home-more-actions .secondary { border-top: 1px solid #e7ece9; }
.home-all-clear { display: flex; min-height: 148px; align-items: center; justify-content: center; gap: 12px; padding: 22px; }
.home-all-clear > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: #e6f3eb; color: #2c7652; font-weight: 950; }
.home-all-clear strong,
.home-all-clear small { display: block; }
.home-all-clear small { margin-top: 3px; color: #748078; }

.home-side-stack { display: grid; gap: 14px; }
.home-environment { overflow: hidden; }
.home-environment-item { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 92px; padding: 13px 15px; }
.home-environment-item + .home-environment-item { border-top: 1px solid #e8eeeb; }
.home-environment-item > span { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 13px; background: #fff3cf; color: #9a6714; font-size: 25px; font-weight: 950; }
.home-environment-item.disease > span { background: #e8f3ed; color: #2c7452; }
.home-environment-item.disease.watch > span,
.home-environment-item.disease.danger > span { background: #fce8e5; color: #ad443b; }
.home-environment-item.disease { position: relative; width: 100%; grid-template-columns: 48px minmax(0, 1fr) auto; border: 0; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.home-environment-item.disease:hover { background: #f7faf8; }
.home-environment-item.disease:focus-visible { z-index: 1; outline: 3px solid rgba(56, 128, 92, .22); outline-offset: -3px; }
.home-environment-item.disease > i { color: #668076; font-size: 22px; font-style: normal; font-weight: 900; }
.home-environment-item small,
.home-environment-item strong,
.home-environment-item em { display: block; min-width: 0; }
.home-environment-item small { color: #78847e; font-size: 10px; font-weight: 850; }
.home-environment-item strong { overflow: hidden; margin-top: 1px; color: #263e32; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.home-environment-item em { display: -webkit-box; overflow: hidden; margin-top: 2px; color: #768179; font-size: 10px; font-style: normal; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.home-weather-metrics { display: flex !important; align-items: center; flex-wrap: wrap; gap: 2px 10px; margin-top: 4px !important; color: #5e6f66 !important; font-size: 14px !important; line-height: 1.45 !important; -webkit-line-clamp: initial !important; }
.home-weather-metrics > span { display: inline; width: auto; height: auto; border-radius: 0; background: none; color: inherit; font-size: inherit; }
.home-weather-basis { color: #7c8982 !important; font-size: 11px !important; -webkit-line-clamp: 1 !important; }
.home-rain-outlook { display: inline; margin: 0; padding: 0; background: none; color: #536d60; font-size: inherit; font-weight: 950; line-height: inherit; }
.home-rain-outlook.expected { background: none; color: #176fa5; }

.home-disease-modal[hidden] { display: none !important; }
.home-disease-modal { position: fixed; inset: 0; z-index: 1000; display: grid; padding: 20px; place-items: center; }
.home-modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(16, 28, 22, .62); cursor: pointer; backdrop-filter: blur(3px); }
.home-modal-card { position: relative; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; width: min(760px, 100%); max-height: min(800px, calc(100vh - 40px)); overflow: hidden; border: 1px solid #d9e4de; border-radius: 20px; background: #fff; box-shadow: 0 24px 70px rgba(13, 36, 25, .28); }
.home-modal-card:focus { outline: none; }
.home-modal-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid #e4ebe7; }
.home-modal-card > header h2 { margin: 2px 0 0; color: #203c2f; font-size: 29px; }
.home-modal-close { display: grid; flex: 0 0 38px; width: 38px; height: 38px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: #f0f4f2; color: #53645b; font-size: 27px; line-height: 1; cursor: pointer; }
.home-disease-summary { padding: 15px 20px; border-bottom: 1px solid #e5ece8; background: #f1f8f4; }
.home-disease-summary.watch { background: #fff8e9; }
.home-disease-summary.danger { background: #fff0ee; }
.home-disease-summary strong { display: block; color: #294c3a; font-size: 21px; }
.home-disease-summary p { margin: 6px 0 0; color: #68766f; font-size: 16px; line-height: 1.55; }
.home-disease-records { display: grid; min-height: 0; align-content: start; gap: 8px; padding: 14px 20px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.home-disease-records article { padding: 15px 16px; border: 1px solid #e0e8e4; border-radius: 12px; background: #fbfcfb; }
.home-disease-records article > div { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.home-disease-records article strong { color: #253f32; font-size: 19px; }
.home-disease-records article span { padding: 4px 8px; border-radius: 6px; background: #e6f3eb; color: #2d7452; font-size: 13px; font-weight: 900; }
.home-disease-records article span.impact { background: #fff0d8; color: #9b5d0b; }
.home-disease-records article span.ended { background: #eef0ef; color: #6e7772; }
.home-disease-records article p { margin: 8px 0 3px; color: #53645b; font-size: 16px; }
.home-disease-records article small { color: #68766f; font-size: 14px; line-height: 1.5; }
.home-disease-empty { display: grid; min-height: 170px; padding: 28px 20px; place-items: center; align-content: center; gap: 6px; text-align: center; }
.home-disease-empty > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: #e6f3eb; color: #2d7452; font-weight: 950; }
.home-disease-empty small { color: #748078; }
.home-modal-card > footer { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 9px; padding: 13px 20px; border-top: 1px solid #e4ebe7; background: #f8faf9; color: #607068; font-size: 14px; }
.home-modal-card > footer small { color: #7b8780; white-space: nowrap; }
.home-modal-card > footer .btn { min-height: 40px; }
body.home-modal-open { overflow: hidden; }
.home-quick-panel { overflow: hidden; }
.home-quick-panel .home-section-heading { min-height: 60px; padding-top: 11px; padding-bottom: 11px; }
.home-quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: #e7ece9; }
.home-quick-grid a { display: flex; min-width: 0; min-height: 79px; align-items: center; justify-content: center; flex-direction: column; gap: 6px; padding: 10px 5px; background: #fff; color: #33483d; text-decoration: none; }
.home-quick-grid a:hover { background: #f1f8f4; color: #1d5d40; }
.home-quick-grid span { color: #3f765c; font-size: 28px; line-height: 1; }
.home-quick-grid strong { max-width: 100%; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.home-barn-shell { margin: 0 0 22px; border: 1px solid #dbe5df; border-radius: 17px; background: #fff; overflow: visible; }
.home-barn-shell > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; min-height: 78px; padding: 13px 17px; border-radius: 17px; cursor: pointer; list-style: none; }
.home-barn-shell > summary::-webkit-details-marker { display: none; }
.home-barn-shell > summary:hover { background: #f7faf8; }
.home-barn-title { display: flex; align-items: center; gap: 11px; }
.home-barn-title > i { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 13px; background: #e8f4ed; color: #2c704f; font-size: 27px; font-style: normal; }
.home-barn-title small,
.home-barn-title strong { display: block; }
.home-barn-title small { color: #78847e; font-size: 10px; }
.home-barn-title strong { margin-top: 1px; color: #243d31; font-size: 17px; }
.home-barn-counts { display: flex; min-width: 0; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; }
.home-barn-counts b { padding: 5px 8px; border-radius: 999px; background: #f0f5f2; color: #51685c; font-size: 10px; white-space: nowrap; }
.home-barn-counts b.warning { background: #fff1dd; color: #996014; }
.home-barn-toggle { display: flex; align-items: center; gap: 7px; color: #356a52; }
.home-barn-toggle i { font-size: 11px; font-style: normal; font-weight: 900; }
.home-barn-toggle b { font-size: 19px; transition: transform .18s ease; }
.home-barn-shell[open] > summary { border-bottom: 1px solid #e1e8e4; border-radius: 17px 17px 0 0; background: #f7faf8; }
.home-barn-shell[open] .home-barn-toggle b { transform: rotate(180deg); }
.home-barn-shell[open] .home-barn-toggle i { font-size: 0; }
.home-barn-shell[open] .home-barn-toggle i::after { font-size: 11px; content: '접기'; }
.home-barn-shell .barn-map-card { margin: 0; border: 0; border-radius: 0 0 17px 17px; box-shadow: none; }
.home-breeding-heading { min-height: auto; margin: 2px 0 10px; padding: 0; border: 0; }
.home-breeding-heading h2 { font-size: 22px; }
.home-breeding-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel-header-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.home-attention-list.is-scrollable {
    max-height: 391px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-color: #91ab9e #eef3f0;
}
.home-attention-list.is-scrollable:focus-visible { outline: 3px solid #e7b848; outline-offset: -3px; }
.home-attention-list.is-scrollable::-webkit-scrollbar { width: 12px; }
.home-attention-list.is-scrollable::-webkit-scrollbar-track { background: #eef3f0; }
.home-attention-list.is-scrollable::-webkit-scrollbar-thumb { border: 3px solid #eef3f0; border-radius: 999px; background: #91ab9e; }
.breeding-check-guide { margin: 0; padding: 10px 14px; border-top: 1px solid #e6ece8; background: #f7faf8; color: #68776f; font-size: 11px; line-height: 1.45; }

/* PC에서는 한눈에 읽히는 크기를 기본값으로 사용한다. */
@media (min-width: 901px) {
    .home-command-copy .eyebrow { font-size: 13px; }
    .home-command-copy p { font-size: 16px; }
    .home-command-search input { font-size: 16px; }
    .home-command-search button { font-size: 15px; }
    .home-kpi > span { font-size: 15px; }
    .home-kpi strong { font-size: 32px; }
    .home-kpi strong small { font-size: 13px; }
    .home-kpi em { font-size: 13px; }
    .home-weather-alert { font-size: 15px; }
    .home-weather-alert strong { font-size: 12px; }
    .home-section-heading .eyebrow { font-size: 12px; }
    .home-section-heading h2 { font-size: 23px; }
    .home-section-heading > a { font-size: 14px; }
    .home-action-row strong { font-size: 16px; }
    .home-action-row small { font-size: 13px; }
    .home-action-row > b { font-size: 13px; }
    .home-more-actions > summary { font-size: 14px; }
    .home-environment-item small { font-size: 12px; }
    .home-environment-item strong { font-size: 16px; }
    .home-environment-item em { font-size: 12px; }
    .home-quick-grid strong { font-size: 13px; }
    .home-barn-title small { font-size: 12px; }
    .home-barn-title strong { font-size: 19px; }
    .home-barn-counts b { font-size: 12px; }
    .home-barn-toggle i,
    .home-barn-shell[open] .home-barn-toggle i::after { font-size: 13px; }
}

/* 기본 글씨도 연세 있는 사용자가 편하게 읽을 수 있는 크기를 유지한다. */
body.app-body { font-size: 19px; }
body.app-body:not(.large-text) .app-main p,
body.app-body:not(.large-text) .app-main li,
body.app-body:not(.large-text) .app-main label,
body.app-body:not(.large-text) .app-main dt,
body.app-body:not(.large-text) .app-main dd,
body.app-body:not(.large-text) .app-main th,
body.app-body:not(.large-text) .app-main td { font-size: 16px !important; }
body.app-body:not(.large-text) .app-main small { font-size: 14px !important; }
body.app-body:not(.large-text) .app-main input,
body.app-body:not(.large-text) .app-main select,
body.app-body:not(.large-text) .app-main textarea,
body.app-body:not(.large-text) .app-main button,
body.app-body:not(.large-text) .app-main .btn { font-size: 16px !important; }
body.app-body:not(.large-text) .app-main .cow-health-chip { font-size: 13px !important; }
body.app-body:not(.large-text) .app-main .cow-health-manual-open { font-size: 13px !important; }

/* 큰 글씨 모드는 고정 px를 쓰는 화면에도 실제로 적용되어야 한다. */
body.large-text .app-main p,
body.large-text .app-main li,
body.large-text .app-main label,
body.large-text .app-main dt,
body.large-text .app-main dd,
body.large-text .app-main th,
body.large-text .app-main td,
body.large-text .app-main input,
body.large-text .app-main select,
body.large-text .app-main textarea,
body.large-text .app-main button,
body.large-text .app-main .btn {
    font-size: 18px !important;
}

body.large-text .app-main small { font-size: 15px !important; }
body.large-text .app-main h1 { font-size: clamp(35px, 3.4vw, 47px) !important; }
body.large-text .app-main h2 { font-size: clamp(26px, 2.5vw, 34px) !important; }
body.large-text .app-main h3 { font-size: 23px !important; }
body.large-text .app-main .eyebrow,
body.large-text .app-main .panel-kicker { font-size: 15px !important; }
body.large-text .side-nav-link { font-size: 19px; }
body.large-text .topbar-guide strong { font-size: 20px; }
body.large-text .topbar-guide span { font-size: 16px; }
body.large-text .text-size-button { font-size: 17px; }
body.large-text .home-kpi > span { font-size: 18px; }
body.large-text .home-kpi strong { font-size: 37px; }
body.large-text .home-kpi em { font-size: 15px; }
body.large-text .home-action-row strong { font-size: 19px; }
body.large-text .home-action-row small,
body.large-text .home-action-row > b { font-size: 15px; }
body.large-text .home-environment-item small { font-size: 14px !important; }
body.large-text .home-environment-item strong { font-size: 19px; }
body.large-text .home-environment-item em { font-size: 14px; }
body.large-text .home-weather-metrics { font-size: 17px !important; }
body.large-text .home-quick-grid strong { font-size: 15px; }
body.large-text .home-barn-title small,
body.large-text .home-barn-counts b { font-size: 14px !important; }
body.large-text .home-barn-title strong { font-size: 21px; }

@media (max-width: 1100px) {
    .home-command { grid-template-columns: minmax(220px, .8fr) minmax(290px, 1.2fr) auto; }
    .home-workspace { grid-template-columns: minmax(0, 1.15fr) minmax(290px, .85fr); }
    .home-breeding-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .home-command { grid-template-columns: 1fr auto; }
    .home-command-search { grid-column: 1 / -1; grid-row: 2; }
    .home-add-cow { grid-column: 2; grid-row: 1; }
    .home-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-workspace { grid-template-columns: 1fr; }
    .home-side-stack { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
    .home-barn-shell .barn-map-card { margin: 0; }
    .home-breeding-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .home-command { gap: 12px; margin-right: -5px; margin-left: -5px; padding: 15px; border-radius: 16px; }
    .home-command-copy h1 { font-size: 27px; }
    .home-command-copy p { max-width: 225px; font-size: 11px; }
    .home-add-cow { min-height: 43px; padding: 8px 11px; font-size: 12px; }
    .home-command-search { min-height: 46px; }
    .home-command-search input { font-size: 13px; }
    .home-kpi-grid { gap: 7px; }
    .home-kpi { min-height: 94px; padding: 12px 12px 12px 16px; }
    .home-kpi strong { font-size: 25px; }
    .home-kpi em { overflow: hidden; text-overflow: ellipsis; }
    .home-weather-alert { grid-template-columns: auto 1fr; }
    .home-weather-alert small { grid-column: 2; }
    .home-side-stack { grid-template-columns: 1fr; }
    .home-disease-modal { padding: 10px; place-items: end center; }
    .home-modal-card { width: 100%; max-height: calc(100vh - 80px); border-radius: 18px 18px 12px 12px; }
    .home-modal-card > header { padding: 15px; }
    .home-modal-card > header h2 { font-size: 25px; }
    .home-disease-summary { padding: 13px 15px; }
    .home-disease-summary strong { font-size: 19px; }
    .home-disease-summary p { font-size: 15px; }
    .home-disease-records { gap: 10px; padding: 10px; }
    .home-disease-records article strong { font-size: 18px; }
    .home-disease-records article p { font-size: 15px; }
    .home-disease-records article small { font-size: 14px; }
    .home-modal-card > footer { grid-template-columns: 1fr auto; padding: 11px 14px; }
    .home-modal-card > footer small { grid-column: 1; }
    .home-modal-card > footer .btn { grid-column: 2; grid-row: 1 / 3; }
    .home-section-heading { min-height: 63px; padding: 12px 14px; }
    .home-section-heading h2 { font-size: 18px; }
    .home-action-row { grid-template-columns: 46px minmax(0, 1fr) 14px; gap: 10px; padding: 9px 12px; }
    .home-action-row > b { overflow: hidden; width: 14px; font-size: 0; }
    .home-action-row > b::after { color: #587166; font-size: 18px; content: '›'; }
    .home-action-row strong { font-size: 13px; }
    .home-action-row small { font-size: 10px; }
    .home-quick-grid a { min-height: 76px; }
    .home-barn-shell { margin-right: -5px; margin-left: -5px; }
    .home-barn-shell > summary { grid-template-columns: 1fr auto; gap: 9px; padding: 12px 14px; }
    .home-barn-counts { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
    .home-barn-toggle i { display: none; }
    .home-barn-shell .barn-map-card { padding: 13px; }
    .home-breeding-heading { margin-top: 1px; }
}
.cow-ability-summary { display:inline-flex; align-items:center; gap:4px; width:max-content; max-width:100%; min-height:30px; margin-top:7px; padding:4px 7px; border-radius:999px; background:#e8f3ee; color:#1e674b; font-size:.88rem; font-weight:850; line-height:1.2; }
.cow-ability-summary b { display:inline-flex; align-items:center; justify-content:center; min-width:22px; height:22px; padding:0 4px; border-radius:7px; }
.cow-ability-summary.ebv { background:#e9efff; color:#3156a0; }
.cow-ability-summary.actual { background:#fff0c7; color:#795100; }
.cow-table-copy { min-width:0; }
.cow-table-copy .cow-ability-summary { margin-top:6px; }
.ability-grade { border:1px solid transparent; font-style:normal; font-weight:900; box-shadow:0 1px 1px rgba(27,47,38,.08); }
.ability-grade[data-grade="A"], .grade-badge.grade-A { border-color:#69ba91 !important; background:#cfeedd !important; color:#0b5c3c !important; }
.ability-grade[data-grade="B"], .grade-badge.grade-B { border-color:#83a8df !important; background:#dce9ff !important; color:#244f8d !important; }
.ability-grade[data-grade="C"], .grade-badge.grade-C { border-color:#e5b84f !important; background:#fff0bd !important; color:#755000 !important; }
.ability-grade[data-grade="D"], .grade-badge.grade-D { border-color:#d58b8b !important; background:#f8dddd !important; color:#8a3030 !important; }
.dam-rank-more { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; min-height:48px; margin-top:12px; border:1px solid #bfd5ca; border-radius:12px; background:#f3f9f6; color:#205e47; font-size:1rem; font-weight:850; cursor:pointer; }
.dam-rank-more small { color:var(--text-secondary); font-size:.9rem; }
.dam-rank-row[hidden] { display:none !important; }
.barn-popover-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.barn-popover-actions .btn { min-height:44px; white-space:nowrap; }
.cctv-selected-card { outline:4px solid #f2c94c; outline-offset:3px; }
@media (max-width:700px) { .barn-popover-actions { grid-template-columns:1fr; } }
.kpn-progeny-section { margin:20px 0; padding:18px; border:1px solid #d3e2da; border-radius:16px; background:#f8fbf9; }
.kpn-progeny-total { padding:7px 11px; border-radius:999px; background:#e4f0ea; font-weight:800; white-space:nowrap; }
.kpn-progeny-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.kpn-progeny-card { padding:13px; border:1px solid #dce6e1; border-radius:13px; background:#fff; }
.kpn-progeny-card header { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.kpn-progeny-card header strong { font-size:1.08rem; }
.kpn-progeny-card header span { padding:3px 6px; border-radius:999px; background:#eef2f0; color:var(--text-secondary); font-size:.76rem; font-weight:800; }
.kpn-progeny-card > b { display:block; margin:8px 0; color:#1f6a4d; font-size:1.55rem; }
.kpn-ability-grades { display:flex; gap:4px; margin-top:9px; }
.kpn-ability-grades b { display:inline-flex; align-items:center; justify-content:center; min-width:24px; height:24px; padding:0 4px; border-radius:7px; font-size:.82rem; }
.kpn-progeny-card dl { display:grid; gap:5px; margin:0; }
.kpn-progeny-card dl div { display:flex; justify-content:space-between; gap:5px; }
.kpn-progeny-card dt { color:var(--text-secondary); font-size:.78rem; }
.kpn-progeny-card dd { margin:0; font-size:.84rem; font-weight:800; }
@media (max-width:1100px) { .kpn-progeny-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:700px) { .kpn-progeny-section { padding:13px; } .kpn-progeny-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .kpn-progeny-card dl div:last-child { grid-column:1/-1; } }
.unknown-price-check { position:relative; display:grid; grid-template-columns:26px minmax(0,1fr); align-items:center; gap:11px; width:100%; margin-top:12px; padding:13px 14px; border:2px solid #d6e0db; border-radius:12px; background:#f8faf9; cursor:pointer; transition:border-color .15s ease,background .15s ease,box-shadow .15s ease; }
.unknown-price-check:hover { border-color:#a9bdb3; background:#f4f8f6; }
.unknown-price-check:focus-within { outline:3px solid rgba(35,119,82,.18); outline-offset:2px; }
.unknown-price-check.checked, .unknown-price-check:has(input:checked) { border-color:#d49a29; background:#fff6dc; box-shadow:0 4px 12px rgba(125,85,6,.08); }
.unknown-price-check input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.unknown-price-box { display:flex; width:26px; height:26px; align-items:center; justify-content:center; border:2px solid #8da298; border-radius:7px; background:#fff; color:#fff; font-size:18px; font-weight:900; }
.unknown-price-check.checked .unknown-price-box, .unknown-price-check:has(input:checked) .unknown-price-box { border-color:#b97700; background:#b97700; }
.unknown-price-check.checked .unknown-price-box::after, .unknown-price-check:has(input:checked) .unknown-price-box::after { content:'✓'; }
.unknown-price-copy { display:flex; min-width:0; flex-direction:column; gap:3px; line-height:1.35; }
.unknown-price-copy b { color:var(--text-primary); font-size:1rem; }
.unknown-price-copy small { color:var(--text-secondary); font-size:.86rem; }
@media (max-width:620px) { .unknown-price-check { padding:12px; } .unknown-price-copy small { font-size:.82rem; } }
.birth-record-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; border-bottom:1px solid #e5eae7; }
.birth-record-row:last-child { border-bottom:0; }
.birth-record-row .simple-record { border-bottom:0; }
.birth-cctv-button { min-width:62px; min-height:42px; margin-right:12px; padding:7px 10px; border:1px solid #8db7a4; border-radius:10px; background:#edf7f2; color:#175f42; font-size:.9rem; font-weight:850; cursor:pointer; }
@media (max-width:620px) { .birth-cctv-button { min-width:58px; margin-right:6px; padding-inline:7px; } }
.herd-insight-grid { display:grid; grid-template-columns:1.35fr .65fr; gap:16px; }
.herd-insight-grid > .card { min-width:0; margin:0; padding:18px; }
.herd-state-insight { grid-column:1/-1; }
.herd-state-chips { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:9px; }
.herd-state-chips span { display:flex; min-width:0; align-items:baseline; gap:3px; padding:12px; border-radius:12px; background:#f1f7f4; }
.herd-state-chips small { flex:1; color:var(--text-secondary); font-weight:800; }
.herd-state-chips strong { font-size:1.45rem; }
.herd-state-chips em { color:var(--text-secondary); font-style:normal; }
.monthly-birth-bars { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:5px; min-height:170px; align-items:end; }
.monthly-birth-bars span { display:grid; grid-template-rows:110px auto auto; gap:3px; text-align:center; }
.monthly-birth-bars i { display:flex; align-items:flex-end; justify-content:center; border-radius:7px; background:#edf3f0; overflow:hidden; }
.monthly-birth-bars i b { width:100%; min-height:2px; background:#46a47c; }
.monthly-birth-bars strong { font-size:.9rem; }
.monthly-birth-bars small { color:var(--text-secondary); font-size:.72rem; }
.calf-mortality-insight { display:grid; grid-template-columns:1fr auto; align-items:start; }
.calf-mortality-insight > strong { color:#257454; font-size:2.6rem; }
.calf-mortality-insight > strong small { font-size:1rem; }
.calf-mortality-insight dl { grid-column:1/-1; display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:18px 0 0; }
.calf-mortality-insight dl div { padding:12px; border-radius:11px; background:#f5f8f6; }
.calf-mortality-insight dt { color:var(--text-secondary); font-size:.8rem; }
.calf-mortality-insight dd { margin:4px 0 0; font-size:1.2rem; font-weight:850; }
.birth-outcome-insight { grid-column:1/-1; }
.birth-outcome-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; }
.birth-outcome-grid span { display:flex; flex-direction:column; gap:3px; padding:11px; border:1px solid #dbe5df; border-radius:11px; background:#fbfdfc; }
.birth-outcome-grid span.empty { opacity:.55; }
.birth-outcome-grid small,.birth-outcome-grid em { color:var(--text-secondary); font-size:.78rem; font-style:normal; }
.birth-outcome-grid strong { font-size:1rem; }
@media (max-width:900px) { .herd-insight-grid { grid-template-columns:1fr; } .herd-state-chips { grid-template-columns:repeat(4,minmax(0,1fr)); } .birth-outcome-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (max-width:620px) { .herd-state-chips { grid-template-columns:repeat(2,minmax(0,1fr)); } .monthly-birth-bars { overflow-x:auto; grid-template-columns:repeat(12,42px); padding-bottom:6px; } .birth-outcome-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
