/* ======================================================================
   CHICKEN (BATCH) MANAGEMENT — mirrors css/cow-management.css rule for rule under the ck-
   prefix, so poultry keeps the same visual language as the livestock
   modules while staying independently restylable.
   ====================================================================== */

:root{
  --ck-section:16px;   /* gap between the page's stacked sections */
  --ck-gap:14px;       /* gap inside a grid                       */
}

/* --- action bar ---------------------------------------------------------- */
.ck-actions{
  display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;
  gap:10px;margin-bottom:var(--ck-section);
}
.ck-actions .btn{display:inline-flex;align-items:center;gap:7px;}

/* --- KPI strip ----------------------------------------------------------- */
.ck-kpis{
  display:grid;grid-template-columns:repeat(6,minmax(0,1fr));
  gap:var(--ck-gap);align-items:stretch;margin-bottom:var(--ck-section);
}
.ck-kpi{
  display:flex;align-items:center;gap:12px;min-width:0;
  padding:15px 16px;border:1px solid var(--border);border-radius:var(--r-lg);
  background:var(--surface);box-shadow:var(--shadow-sm);
}
.ck-kpi__art{width:40px;height:40px;flex:none;}
.ck-kpi__art svg{width:100%;height:100%;display:block;}
.ck-kpi__txt{display:flex;flex-direction:column;gap:2px;min-width:0;}
.ck-kpi__lbl{font-size:12.5px;font-weight:600;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
/* "Total value (Tk)" is the longest figure on this page. In the two-column
   phone layout the card leaves it about 90px, and 23px needs ~127px, so the
   amount was cut off mid-number at the card edge. Size follows --ck-kpi-val
   (stepped at the bottom of this file); min-width:0 and overflow-wrap keep any
   remaining case inside the card instead of over its edge. */
.ck-kpi__val{
  font-size:var(--ck-kpi-val,23px);font-weight:700;line-height:1.15;
  color:var(--ink);font-family:var(--font-en);min-width:0;overflow-wrap:anywhere;
}
.ck-kpi__sub{font-size:11.5px;line-height:1.3;color:var(--muted);font-family:var(--font-en);}

.ck-kpi--green {background:#f8fbf8;border-color:#e2efe7;}  .ck-kpi--green  .ck-kpi__lbl{color:var(--green-600);}
.ck-kpi--blue  {background:#f4f8fe;border-color:#d8e5f8;}  .ck-kpi--blue   .ck-kpi__lbl{color:var(--blue);}
.ck-kpi--red   {background:#fef5f6;border-color:#fbdedd;}  .ck-kpi--red    .ck-kpi__lbl{color:var(--danger);}
.ck-kpi--amber {background:#fef9f2;border-color:#f7e6cb;}  .ck-kpi--amber  .ck-kpi__lbl{color:var(--orange);}
.ck-kpi--purple{background:#faf8fe;border-color:#e7defa;}  .ck-kpi--purple .ck-kpi__lbl{color:var(--purple);}
.ck-kpi--cyan  {background:#f7fbfe;border-color:#d9e9f6;}  .ck-kpi--cyan   .ck-kpi__lbl{color:#0e7490;}

/* --- sales / loss summary cards ------------------------------------------
   A separate row below the six-up KPI strip rather than part of it: these
   carry four figures each, so they need the width two cards give them and the
   strip above keeps the layout it always had. */
.ck-fin{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:var(--ck-gap);align-items:stretch;margin-bottom:var(--ck-section);
}
.ck-fin__card{
  display:flex;align-items:flex-start;gap:13px;min-width:0;width:100%;text-align:left;
  padding:15px 16px;border:1px solid var(--border);border-radius:var(--r-lg);
  background:var(--surface);box-shadow:var(--shadow-sm);
  font-family:inherit;cursor:pointer;transition:box-shadow .16s,transform .16s;
}
.ck-fin__card:hover{box-shadow:var(--shadow-md,0 4px 14px rgba(16,32,22,.10));transform:translateY(-1px);}
.ck-fin__card:focus-visible{outline:2px solid var(--green-600);outline-offset:2px;}
.ck-fin__art{
  width:40px;height:40px;flex:none;border-radius:50%;display:grid;place-items:center;
}
.ck-fin__body{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1;}
.ck-fin__lbl{font-size:12.5px;font-weight:600;line-height:1.25;}
.ck-fin__val{
  font-size:var(--ck-kpi-val,23px);font-weight:700;line-height:1.15;
  color:var(--ink);font-family:var(--font-en);min-width:0;overflow-wrap:anywhere;
}
.ck-fin__meta{font-size:11.5px;line-height:1.3;color:var(--muted);}
.ck-fin__cmp{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  margin-top:5px;font-size:11.5px;line-height:1.35;font-family:var(--font-en);
}
.ck-fin__mo{color:var(--ink-2);font-weight:600;}
.ck-fin__flat{color:var(--muted);}
.ck-fin__go{
  flex:none;color:var(--muted);display:flex;align-items:center;
  transform:rotate(180deg);margin-top:2px;
}
/* Trend art — fills the gap that sat empty between the figures and the open
   arrow. It takes no space from .ck-fin__body (which keeps flex:1) and sits at
   the bottom of the card so it lines up with the month/comparison row rather
   than the label. Colour comes from the card tint via currentColor below. */
.ck-fin__trend{
  flex:none;display:flex;align-items:flex-end;align-self:stretch;
  margin-left:6px;pointer-events:none;
}
.ck-fin__trendsvg{display:block;overflow:visible;}
.ck-fin__card--green{background:#f8fbf8;border-color:#e2efe7;}
.ck-fin__card--green .ck-fin__lbl{color:var(--green-600);}
.ck-fin__card--green .ck-fin__art{background:#e6f2ea;color:var(--green-600);}
.ck-fin__card--green .ck-fin__trend{color:var(--green-600);}
.ck-fin__card--red{background:#fef5f6;border-color:#fbdedd;}
.ck-fin__card--red .ck-fin__lbl{color:var(--danger);}
.ck-fin__card--red .ck-fin__art{background:#fbe3e3;color:var(--danger);}
.ck-fin__card--red .ck-fin__trend{color:var(--danger);}

/* --- tab rail + filter bar (one card) ------------------------------------ */
.ck-panel{margin-bottom:var(--ck-section);overflow:hidden;}
.ck-tabs{
  display:flex;align-items:stretch;overflow-x:auto;
  border-bottom:1px solid var(--border);
}
.ck-tab{
  flex:none;padding:13px 17px;background:none;border:0;
  border-right:1px solid var(--border);border-bottom:2px solid transparent;
  font-family:inherit;font-size:12.5px;font-weight:600;line-height:1.2;
  color:var(--muted);white-space:nowrap;cursor:pointer;transition:.14s;
}
.ck-tab:hover{background:var(--green-050);color:var(--green-600);}
.ck-tab.is-active{color:var(--green-600);border-bottom-color:var(--green-500);background:var(--surface);}

.ck-filters{
  display:flex;align-items:flex-end;flex-wrap:wrap;gap:12px;padding:15px 18px;
}
.ck-field{display:flex;flex-direction:column;gap:6px;min-width:0;flex:0 0 168px;}
.ck-field--grow{flex:1 1 240px;}
.ck-field--btn{flex:none;}
.ck-field__lbl{font-size:12px;font-weight:600;line-height:1.2;color:var(--ink-2);}
.ck-field .inp{width:100%;}

.ck-search{display:flex;align-items:stretch;gap:0;min-width:0;}
.ck-search .inp{
  flex:1;min-width:0;border-top-right-radius:0;border-bottom-right-radius:0;
}
.ck-search__go{
  flex:none;display:grid;place-items:center;padding:0 15px;
  border-top-left-radius:0;border-bottom-left-radius:0;
}

/* --- main split: table + side rail --------------------------------------- */
.ck-main{
  display:grid;grid-template-columns:minmax(0,1fr) 320px;
  gap:var(--ck-gap);align-items:start;
}
.ck-list{display:flex;flex-direction:column;min-width:0;}
.ck-list .card__head{flex:none;}
.ck-list__count{font-size:12.5px;font-weight:500;color:var(--muted);font-family:var(--font-en);}
.ck-list .tbl-wrap{border:0;border-radius:0;box-shadow:none;}

.ck-tbl th{white-space:nowrap;}
.ck-tbl td{padding:10px 16px;}
.ck-photo{
  display:block;width:52px;height:42px;border-radius:var(--r-sm);
  overflow:hidden;border:1px solid var(--border);background:var(--canvas);
}
.ck-photo svg,
.ck-photo img{width:100%;height:100%;display:block;}
.ck-photo img{object-fit:cover;}
.ck-id{font-family:var(--font-en);font-size:13px;font-weight:600;color:var(--green-600);}
.ck-name{font-weight:600;}
.ck-num{font-family:var(--font-en);}
.ck-empty{text-align:center;padding:40px;color:var(--muted);}

.ck-sex{
  display:inline-grid;place-items:center;width:26px;height:26px;border-radius:50%;
  font-size:15px;line-height:1;font-family:var(--font-en);
}
.ck-sex--bull{background:var(--info-bg);color:var(--blue);}
.ck-sex--cow {background:var(--danger-bg);color:var(--danger);}
.ck-sex--calf{background:var(--warning-bg);color:var(--orange);}

.ck-act{text-align:right;white-space:nowrap;}
.ck-ib{
  width:28px;height:28px;margin-left:5px;border-radius:7px;cursor:pointer;
  display:inline-grid;place-items:center;vertical-align:middle;
  border:1px solid var(--border);background:var(--surface);
  font-size:15px;line-height:1;transition:.13s;
}
.ck-ib--view{color:var(--green-600);} .ck-ib--view:hover{background:var(--green-050);border-color:var(--green-400);}
.ck-ib--edit{color:var(--blue);}      .ck-ib--edit:hover{background:var(--info-bg);border-color:#a8c8f2;}
.ck-ib--more{color:var(--muted);}     .ck-ib--more:hover{background:var(--canvas);border-color:var(--border-strong);}

/* --- table footer: count / per-page / pager ------------------------------ */
.ck-foot{
  display:flex;align-items:center;flex-wrap:wrap;gap:12px;
  padding:13px 18px;border-top:1px solid var(--border);
}
.ck-foot__info{font-size:12.5px;color:var(--muted);flex:1;min-width:0;}
.ck-foot__per{
  display:flex;align-items:center;gap:8px;flex:none;
  font-size:12.5px;color:var(--ink-2);
}
.ck-foot__per .inp{width:auto;min-width:72px;padding:7px 10px;}

.ck-pg{display:flex;align-items:center;gap:5px;flex:none;flex-wrap:wrap;}
.ck-pg__b{
  min-width:32px;height:32px;padding:0 8px;border-radius:8px;cursor:pointer;
  border:1px solid var(--border);background:var(--surface);
  font-family:var(--font-en);font-size:12.5px;color:var(--ink-2);transition:.13s;
}
.ck-pg__b:hover:not(:disabled):not(.is-on){background:var(--green-050);border-color:var(--green-400);color:var(--green-600);}
.ck-pg__b:disabled{opacity:.4;cursor:default;}
.ck-pg__b.is-on{background:var(--green-500);border-color:var(--green-500);color:#fff;font-weight:600;}
.ck-pg__gap{padding:0 2px;color:var(--muted-2);font-size:12.5px;}

/* --- side rail ----------------------------------------------------------- */
.ck-side{display:flex;flex-direction:column;gap:var(--ck-gap);min-width:0;}

.ck-sum{display:flex;flex-direction:column;gap:2px;}
.ck-sum__row{display:flex;align-items:center;gap:9px;padding:7px 0;min-width:0;}
.ck-sum__ico{width:20px;height:20px;flex:none;}
.ck-sum__ico svg{width:100%;height:100%;display:block;}
.ck-sum__lbl{flex:1;min-width:0;font-size:12.5px;color:var(--ink-2);line-height:1.3;}
.ck-sum__n{font-family:var(--font-en);font-size:14px;font-weight:700;line-height:1.2;}
.ck-sum__u{font-size:11.5px;color:var(--muted);flex:none;}
.ck-sum__n--ok{color:var(--green-500);} .ck-sum__n--bad{color:var(--danger);}
.ck-sum__n--warn{color:var(--orange);}  .ck-sum__n--info{color:var(--blue);}
.ck-sum__n--purple{color:var(--purple);}

.ck-grp{display:flex;flex-direction:column;gap:2px;}
.ck-grp__row{display:flex;align-items:center;gap:9px;padding:8px 0;min-width:0;}
.ck-grp__lbl{flex:1;min-width:0;font-size:12.5px;color:var(--ink-2);line-height:1.3;}
.ck-grp__n{font-family:var(--font-en);font-size:14px;font-weight:700;color:var(--ink);line-height:1.2;}
.ck-grp__u{font-size:11.5px;color:var(--muted);flex:none;}
.ck-grp__row--total{
  margin-top:6px;padding:10px 12px;border-radius:var(--r-sm);
  background:var(--green-050);
}
.ck-grp__row--total .ck-grp__lbl,
.ck-grp__row--total .ck-grp__n,
.ck-grp__row--total .ck-grp__u{color:var(--green-600);font-weight:700;}

.ck-quick{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.ck-qa{
  display:flex;align-items:center;gap:8px;min-width:0;min-height:44px;
  padding:10px 11px;border:1px solid var(--border);border-radius:var(--r-md);
  background:var(--surface);text-align:left;cursor:pointer;transition:.14s;
}
.ck-qa:hover{transform:translateY(-1px);box-shadow:var(--shadow-md);}
.ck-qa__ico{display:grid;place-items:center;flex:none;}
.ck-qa__lbl{flex:1;min-width:0;font-size:12px;font-weight:600;line-height:1.3;overflow-wrap:anywhere;}
.ck-qa--green {background:var(--success-bg);border-color:#cfe9d8;} .ck-qa--green  .ck-qa__ico,.ck-qa--green  .ck-qa__lbl{color:var(--green-600);}
.ck-qa--purple{background:var(--purple-bg);border-color:#e2dbf7;}  .ck-qa--purple .ck-qa__ico,.ck-qa--purple .ck-qa__lbl{color:var(--purple);}
.ck-qa--blue  {background:var(--info-bg);border-color:#d5e2fa;}    .ck-qa--blue   .ck-qa__ico,.ck-qa--blue   .ck-qa__lbl{color:#1a5fc4;}
.ck-qa--amber {background:var(--warning-bg);border-color:#f2e2bf;} .ck-qa--amber  .ck-qa__ico,.ck-qa--amber  .ck-qa__lbl{color:#b5730a;}
.ck-qa--red   {background:var(--danger-bg);border-color:#f7d8d5;}  .ck-qa--red    .ck-qa__ico,.ck-qa--red    .ck-qa__lbl{color:#c0362d;}

/* ==========================================================================
   RESPONSIVE — same breakpoints as css/responsive.css
   ========================================================================== */
@media (max-width:1450px){
  .ck-kpis{grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media (max-width:1240px){
  .ck-main{grid-template-columns:1fr;}
  .ck-side{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;}
}
@media (max-width:760px){
  :root{--ck-section:14px;--ck-gap:12px;}
}
@media (max-width:720px){
  .ck-kpis{grid-template-columns:repeat(2,minmax(0,1fr));}
  .ck-fin{grid-template-columns:1fr;}
  /* One card per row here, so the art has room again — just a little smaller. */
  .ck-fin__trendsvg{width:44px;height:35px;}
  .ck-side{grid-template-columns:1fr;}
  .ck-field{flex:1 1 100%;}
  .ck-actions{justify-content:stretch;}
  .ck-actions .btn{flex:1;justify-content:center;}
  .ck-foot{gap:10px;}
  .ck-foot__info{flex:1 1 100%;}
  .ck-quick{grid-template-columns:1fr;}
}

/* Below this the money figure needs the whole width, and the round icon on the
   left already carries the card's meaning — so the trend art steps aside. */
@media (max-width:400px){
  .ck-fin__trend{display:none;}
}

/* ==========================================================================
   TAB SCREENS (health, breeding, feed, weight, milk, vaccine, loss, sales,
   purchase, reports) — added alongside the herd table, same visual language.
   ========================================================================== */

/* --- KPI cards that filter -------------------------------------------- */
.ck-kpi--btn{
  font-family:inherit;text-align:inherit;cursor:pointer;
  transition:transform .14s, box-shadow .14s, border-color .14s;
}
.ck-kpi--btn:hover{transform:translateY(-1px);box-shadow:var(--shadow-md);}
.ck-kpi--btn.is-on{border-color:var(--green-500);box-shadow:0 0 0 2px var(--green-050);}
.ck-kpi--btn.is-on .ck-kpi__val{color:var(--green-700);}

/* --- summary rail rows are filters too --------------------------------- */
.ck-sum__row{
  width:100%;border:0;background:none;font-family:inherit;text-align:inherit;
  border-radius:var(--r-sm);transition:.14s;
}
button.ck-sum__row{cursor:pointer;}
button.ck-sum__row:hover{background:var(--green-050);}

/* --- record tables ------------------------------------------------------ */
.ck-rec .card__head{display:flex;align-items:center;justify-content:space-between;gap:12px;}
.ck-rec__csv{flex:none;}
.ck-rid{
  border:0;background:none;padding:0;font-family:var(--font-en);font-size:12.5px;
  font-weight:700;color:var(--green-600);cursor:pointer;
}
.ck-rid:hover{text-decoration:underline;}
.ck-dim{color:var(--muted-2);}
.ck-up{color:var(--success);font-weight:600;}
.ck-down{color:var(--danger);font-weight:600;}
.ck-tbl .cd-chip{font-size:11px;}
.ck-filters[hidden]{display:none;}

/* --- reports ------------------------------------------------------------ */
.ck-rep{display:flex;flex-direction:column;gap:var(--ck-gap);}
.ck-rep__tiles{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:var(--ck-gap);
}
.ck-rep__tile{
  display:flex;flex-direction:column;gap:3px;padding:15px 16px;
  border:1px solid var(--border);border-left:3px solid var(--border-strong);
  border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--shadow-sm);
}
.ck-rep__lbl{font-size:12.5px;font-weight:600;color:var(--ink-2);line-height:1.3;}
.ck-rep__val{font-size:21px;font-weight:700;color:var(--ink);font-family:var(--font-en);line-height:1.2;}
.ck-rep__val .ck-num{font-size:21px;font-weight:700;}
.ck-rep__sub{font-size:11.5px;color:var(--muted);line-height:1.35;}
.ck-rep__tile--green {border-left-color:var(--green-500);}
.ck-rep__tile--blue  {border-left-color:var(--blue);}
.ck-rep__tile--amber {border-left-color:var(--orange);}
.ck-rep__tile--purple{border-left-color:var(--purple);}
.ck-rep__tile--red   {border-left-color:var(--danger);}
.ck-rep__tile--cyan  {border-left-color:#0e9aa7;}
/* Two columns at most — at three, a five-column table loses its last column. */
.ck-rep__grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(470px,1fr));
  gap:var(--ck-gap);align-items:start;
}
.ck-rep__card .tbl{min-width:0;}
.ck-rep__card .tbl th,.ck-rep__card .tbl td{padding-left:12px;padding-right:12px;white-space:nowrap;}
.ck-rep__card .tbl-wrap{border:0;border-radius:0;box-shadow:none;}

@media(max-width:640px){
  .ck-rep__grid{grid-template-columns:1fr;}
  .ck-rec .card__head{flex-wrap:wrap;}
}

/* Breed-wise entry point: the breed filter is what answers that question, so
   the route opens the herd table with it focused and briefly outlined. */
.ck-filters .inp.is-hl{border-color:var(--green-500);box-shadow:0 0 0 3px var(--green-050);}

/* "Total value (Tk)" figure size. The KPI grid is six columns above 1450px and
   two columns below 720px, and both of those leave the figure a narrow slot -
   the amount needs about 5.5x its font size in width, against roughly
   (card - 32 padding - 40 artwork - 12 gap). These are the measured points at
   which 23px stops fitting on one line. Between 720px and 1450px the grid is
   three columns and the cards are wide enough for the full size. */
@media (min-width:1451px) and (max-width:1700px){ :root{--ck-kpi-val:18px;} }
@media (max-width:460px){ :root{--ck-kpi-val:18px;} }
@media (max-width:400px){ :root{--ck-kpi-val:15px;} }
