/* @import url("ehr_legacy_03_stablelist - will.css"); */
/* Stable Horse List Styles - Properly Prefixed */

.stable_horse_list_body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

.horse_status {
  display: inline-flex;
  align-items: center;      /* vertically centers bubble with the text */
  gap: 8px;                 /* space between bubble and label */
  font-family: sans-serif;
  font-size: 14px;
}

.horse_status_bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;       /* makes it a circle */
  background: #f2f4f7;
  border: 1px solid #d0d5dd;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;           /* keeps the circle from squishing */
}

.horse_status_label {
  text-transform: capitalize; /* shows "Sharp" (optional) */
  color: #344054;
}

/* PHONEFIT_20261022 (player notes 10-22, Android: Stables and Results not all visible, no way to scroll sideways): the page
   frame clips sideways overflow (ehr_base.css), so on a phone a table wider than the screen was cut off. Stables and
   Entries now slide sideways inside this box (Entries Results is 391px wide at a 360px phone). */
@media (max-width: 640px) {
  .stable_horse_list_container { overflow-x: auto; }
}
.stable_horse_list_container {
    margin-bottom: var(--pg-gap);
    border: 1px solid var(--ehr-border);
    border-radius: var(--pg-radius);
    background: var(--ehr-surface-bg);
    color: var(--ehr-card-primary-body-text);
    box-shadow: var(--pg-card-shadow);
}

.stable_pagination_controls { 
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ehr-text-secondary);
}

.stable_horse_list_header {
    background: linear-gradient(to bottom, #90EE90, #7CCD7C);
    border: 3px solid #228B22;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.stable_horse_list_header h1 {
    margin: 0;
    font-size: 24px;
    color: #000;
}

.stable_horse_list_header_info {
    font-size: 14px;
    font-weight: bold;
}

.stable_horse_list_table {
    width: 100%;
    border-collapse: collapse;
    color: var(--ehr-text-primary);
}

/* Column widths for table-layout:fixed.
   Horse name gets a percentage to take remaining space.
   Data columns get small fixed widths.
   NOTE: Adjust these based on actual content. */
/* .stable_horse_list_table > thead > tr > th:nth-child(2) {
    width: 25%;
} */
.stable_horse_list_col_quick   { width: 70px; }
.stable_horse_list_col_status  { width: 70px; }
.stable_horse_list_col_age     { width: 60px; }
.stable_horse_list_col_sex     { width: 60px; }
.stable_horse_list_col_bred    { width: 60px; }
.stable_horse_list_col_sire    { width: 135px; }
.stable_horse_list_col_last    { width: 45px; }
.stable_horse_list_col_r       { width: 45px; }
.stable_horse_list_col_w       { width: 45px; }
.stable_horse_list_col_p       { width: 45px; }
.stable_horse_list_col_s       { width: 45px; }
.stable_horse_list_col_usd     { width: 65px; }
.stable_horse_list_col_itm     { width: 65px; }
.stable_horse_list_col_badges  { width: 75px; }
.stable_horse_list_col_expand  { width: 25px !important; }

/* .stable_horse_list_col_sex .badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    width: 20px;
    height: 20px;
 }

.stable_horse_list_col_sex .badge.f { background: lightpink; }
.stable_horse_list_col_sex .badge.m { background: lightblue; }
.stable_horse_list_col_sex .badge.g { background: tan; } */

.stable_horse_list_table > thead th {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid var(--ehr-border);
    background: var(--ehr-table-header-bg);
    color: var(--ehr-table-header-text);
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stable_horse_list_table > thead th > span {
    display: block;
    width: 0;          /* contributes no width of its own, so the cell can't grow to fit it */
    min-width: 100%;   /* then stretch to whatever width the column actually gets */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* .stable_horse_list_table > thead th .stable-sort-arrow {
    position: absolute;
    left: 100%;
    margin-left: 2px;
    margin-top: 1px;
    opacity: 0.3;
} */

/* Any hidden TH/TD in the stable table must also have width:0
   so table-layout:fixed doesn't allocate dead whitespace for them */
.stable_horse_list_table th[style*="display: none"],
.stable_horse_list_table td[style*="display: none"],
.stable_horse_list_table th[style*="display:none"],
.stable_horse_list_table td[style*="display:none"] {
    width: 0 !important;
    padding: 0 !important;
    overflow: hidden;
}

.stable_horse_list_table td {
    border-bottom: 1px solid var(--ehr-border);
    padding: 8px 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
    font-variant-numeric: tabular-nums;
}

.stable_horse_list_table > thead > tr > th:hover {
    background-color: #c2c2c2;
    background-color: color-mix(in srgb, var(--ehr-table-header-bg), black 30%);
}

.stable_horse_list_horse_name {
    font-family: "Saira Condensed", sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .05em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stable_horse_list_horse_details {
    color: var(--ehr-text-muted);
    font-size: .9em;
}

 .stable_horse_icon_image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 24px;
    object-fit: contain;
 }

.stable_horse_list_badges {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.stable_horse_list_badge {
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    color: #ffffff;
    border: 1px solid #000;
}

.stable_horse_list_badge_gp { 
    background-color: #FFD700; 
    color: black; 
}

.stable_horse_list_badge_sw { 
    background-color: #4169E1; 
}

.stable_horse_list_badge_250 { 
    background-color: #228B22; 
}

.stable_horse_list_badge_100 { 
    background-color: #228B22; 
}

.stable_horse_list_badge_500 { 
    background-color: #8B4513; 
}

.stable_horse_list_badge_gm { 
    background-color: #C0C0C0; 
    color: #000; 
}

.stable_horse_list_badge_star { 
    background-color: #FFD700; 
    color: #000; 
}

.stable_horse_list_badge_1m { 
    background-color: #4169E1; 
}

.stable_horse_list_status_active {
    color: #228B22;
    font-weight: bold;
}

.stable_horse_list_status_inactive {
    color: #999;
}

.stable_horse_list_money {
    text-align: right;
    font-weight: bold;
}

.stable_horse_list_center {
    text-align: center !important;
}

.stable_horse_list_right {
    text-align: right !important;
}


.stable_horse_list_expand_toggle {
    cursor: pointer;
    /* color: var(--ehr-theme-strong); */
    font-weight: bold;
    user-select: none;
    display: none;
    padding: 4px 8px;
}

.stable_horse_list_expand_toggle:hover {
    color: #004499;
}

.stable_horse_list_expanded_info {
    display: none;
    padding: 10px;
    grid-column: 1 / -1;
    white-space: normal;
}

.stable_horse_list_expanded_info.stable_horse_list_show {
    display: block;
}

.stable_horse_list_expanded_row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
    margin-top: 4px;
}

/* Fight style_more.css: .stable_horse_list_horse_detail_cell div { width: 100% }
   Grid items need width:auto so auto-fill can create multiple columns */
.stable_horse_list_expanded_row > div {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
}

.stable_horse_list_expanded_item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #fff;
    border: 1px solid var(--ehr-border);
    border-radius: 4px;
    padding: 5px 8px;
    border-left: 3px solid var(--ehr-theme-raised);
}

.stable_horse_list_expanded_label {
    font-weight: 700;
    font-size: 9px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stable_horse_list_expanded_value {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

@media (min-width: 650px) {
    .stable_horse_list_expanded_row {
        display: none;
    }

    .stable_horse_list_expanded_item {
        display: flex;
        flex-direction: column;
        min-width: 80px;
    }

    .stable_horse_list_expanded_label {
        font-weight: 600;
        font-size: 0.75rem;
        color: #666;
        text-transform: uppercase;
        margin-bottom: 4px;
    }

    .stable_horse_list_expanded_value {
        font-size: 0.95rem;
    }
} 

/* Responsive column hiding - Progressive disclosure */
@container content (max-width: 1400px) {
    /* .stable_horse_list_col_p,
    .stable_horse_list_col_s {
        display: none;
    } */
    .stable_horse_list_expand_toggle {
        display: inline-block;
    }
}

/* Scope to ONLY the cell itself and its direct child wrapper div.
   The old rule matched all descendant divs + tables which forced width:100%
   on every internal horsepage element, overriding the responsive column-hiding
   system and causing all PP columns to display regardless of viewport size. */
/* .stable_horse_list_horse_detail_cell > div {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
} */

/* 🍞 BREADCRUMB: With table-layout:fixed + width:100%, the table always
   fills its container. The detail row's colspan="100" now spans the full
   table width, giving horsepage the space it needs. */
.stable_horse_list_horse_detail_row {
    width: 100% !important;
}

/* 🍞 BREADCRUMB: ehr_content.css:82 has:
       .stable_horse_list_table td:first-child { display: flex }
   This matches the detail cell TD because it's the only (thus first) child
   in the detail row. display:flex on the TD breaks the horsepage layout
   by making horsepage_wrapper a flex item instead of a normal block child.
   Fix: reset to table-cell on the detail cell specifically. */
.stable_horse_list_horse_detail_cell {
    display: table-cell !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    white-space: normal !important;
    text-overflow: clip !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   FIGHTING style_more.css
   
   style_more.css has these rules we can't edit:
     .stable_horse_list_horse_detail_cell div   { width: 100% !important; max-width: 100% !important }
     .stable_horse_list_horse_detail_cell table  { width: 100% !important; table-layout: auto !important }
     .stable_horse_list_horse_detail_cell > *    { width: 100% !important }
   
   Hostile specificity: (0,1,1) with !important.
   
   width:100% is FINE for most block-level divs (they naturally fill their parent).
   It BREAKS flex-row children and grid children, forcing them to stack vertically.
   
   Strategy: Only override width on divs that are children of multi-column 
   flex/grid containers. Use specificity (0,2,1) to beat (0,1,1).
   ═══════════════════════════════════════════════════════════════════════ */

/* --- horsepage_top: 3-column flex layout (identity | stats | right) --- */
.stable_horse_list_horse_detail_cell .horsepage_top {
    display: flex !important;
    flex-wrap: wrap !important;
}
.stable_horse_list_horse_detail_cell .horsepage_top > div {
    width: auto !important;
    max-width: none !important;
}
/* Restore the specific flex sizing on each column.
   Identity uses ~30% to roughly align with the stable table's 30% horsename column.
   Stats and right split the remaining ~70% (matching the data columns area).
   At narrow widths, flex-wrap kicks in. */
/* .stable_horse_list_horse_detail_cell .horsepage_identity {
    flex: 0 1 30% !important;
    width: auto !important;
    max-width: none !important;
    min-width: 180px !important;
} */
/* .stable_horse_list_horse_detail_cell .horsepage_stats_col {
    flex: 1 1 35% !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
} */
/* .stable_horse_list_horse_detail_cell .horsepage_right_col {
    flex: 1 1 28% !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
} */


/* --- horsepage_pedigree_banner: full-width, must not be capped by style_more --- */
.stable_horse_list_horse_detail_cell .horsepage_pedigree_banner {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

/* --- horsepage_image_block: image + owner/breeder side by side --- */
/* .stable_horse_list_horse_detail_cell .horsepage_image_block > div {
    width: auto !important;
    max-width: none !important;
} */

/* --- PP detail grid: cards should wrap in multi-column grid --- */
.stable_horse_list_horse_detail_cell .horsepage_pp_detail_grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
    min-width: 0 !important;
    /* Ensure grid doesn't use intrinsic sizing to blow out the table */
    width: 100% !important;
}
.stable_horse_list_horse_detail_cell .horsepage_pp_detail_grid > div {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
}

/* The PP detail row's TD (colspan) needs a definite width for CSS Grid's
   auto-fill to calculate how many columns fit. In table-layout:auto, the TD
   has no definite width, so auto-fill falls back to 1 column.
   Fix: give the TD width:100% AND overflow:hidden. The overflow creates a
   block formatting context that gives the grid a definite width to work with,
   while preventing the grid from expanding the TD beyond the table. */
.stable_horse_list_horse_detail_cell .horsepage_pp_detail_row > td {
    width: 100% !important;
    overflow: hidden !important;
    /* Give the grid breathing room */
    padding: 10px 12px !important;
}

/* --- Owner grid children --- */
/* .stable_horse_list_horse_detail_cell .horsepage_owner_grid > div {
    width: auto !important;
    max-width: none !important;
} */

/* --- RAFI two-column layout --- */
/* .stable_horse_list_horse_detail_cell .horsepage_rafi_2col > div {
    width: auto !important;
    max-width: none !important;
} */
/* .stable_horse_list_horse_detail_cell .horsepage_rafi_body > div {
    width: auto !important;
    max-width: none !important;
} */

/* --- Dam header (label + button side by side) --- */
/* .stable_horse_list_horse_detail_cell .horsepage_dam_header > * {
    width: auto !important;
    max-width: none !important;
} */

/* --- Badges row --- */
/* .stable_horse_list_horse_detail_cell .horsepage_badges > * {
    width: auto !important;
    max-width: none !important;
} */

/* --- Control/checkbox rows --- */
/* .stable_horse_list_horse_detail_cell .horsepage_control_row > * {
    width: auto !important;
    max-width: none !important;
} */
/* .stable_horse_list_horse_detail_cell .horsepage_checkbox_row > * {
    width: auto !important;
    max-width: none !important;
} */

/* --- PP icon row --- */
/* .stable_horse_list_horse_detail_cell .horsepage_pp_icons > * {
    width: auto !important;
    max-width: none !important;
} */

/* --- Stat grid (the 2x4 stat cards) --- */
/* .stable_horse_list_horse_detail_cell .horsepage_stat_grid {
    display: grid !important;
} */
/* .stable_horse_list_horse_detail_cell .horsepage_stat_grid > div {
    width: auto !important;
    max-width: none !important;
} */

/* --- RAFI tabs, selects, buttons --- */
/* .stable_horse_list_horse_detail_cell .horsepage_rafi_tabs > * {
    width: auto !important;
    max-width: none !important;
}
.stable_horse_list_horse_detail_cell .horsepage_rafi_select_row > * {
    width: auto !important;
    max-width: none !important;
}
.stable_horse_list_horse_detail_cell .horsepage_rafi_buttons > * {
    width: auto !important;
    max-width: none !important;
} */

/* ═══════════════════════════════════════════════════════════════════════
   STABLE HORSE LIST: responsive rules
   Every query measures the content area (.ehr-page-container, container-name:
   content), not the viewport.

   ORDER MATTERS: widest to narrowest, so a narrower rule overrides a wider one
   at equal specificity. Add new breakpoints in their place in the list.
   Each block says what it does: HIDE (a column), WIDTH, LAYOUT, TEXT.
   Commented-out rules are kept in place so they can be switched back on.
   ═══════════════════════════════════════════════════════════════════════ */

@container content (max-width: 1300px) {
    /* HIDE */
    .stable_horse_list_col_bred { display: none; }
}

/* HIDE (off). Was an @media rule; written as @container here so it measures the content area like the rest. */
/* @container content (max-width: 1200px) {
    .stable_horse_list_col_r {
        display: none;
        width: 0 !important;
        padding: 0 !important;
        overflow: hidden;
    }
} */

@container content (max-width: 1100px) {
    /* HIDE */
    .stable_horse_list_col_itm,
    .stable_horse_list_col_sire { display: none; }

    /* LAYOUT (3 -> 2 columns in the horsepage_top flex layout inside the detail cell):
       the right column wraps below; identity and stats stay side by side */
    /* .stable_horse_list_horse_detail_cell .horsepage_identity {
        flex: 0 1 35% !important;
        width: 35% !important;
        max-width: 35% !important;
    } */
    .stable_horse_list_horse_detail_cell .horsepage_stats_col {
        flex: 1 1 55% !important;
    }
    .stable_horse_list_horse_detail_cell .horsepage_right_col {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* HIDE (off) */
/* @container content (max-width: 1000px) {
    .stable_horse_list_col_usd {
        display: none;
        width: 0 !important;
        padding: 0 !important;
        overflow: hidden;
    }
} */

/* HIDE (off). Was an @media rule; written as @container here so it measures the content area like the rest. */
/* @container content (max-width: 900px) {
    .stable_horse_list_col_w {
        display: none;
        width: 0 !important;
        padding: 0 !important;
        overflow: hidden;
    }
} */

@container content (max-width: 800px) {
    /* HIDE */
    .stable_horse_list_col_badges { display: none; }
}

@container content (max-width: 768px) {
    /* LAYOUT (2 -> 1 column): identity and stats stack too.
       The right column already went full width at 1100px. */
    .stable_horse_list_horse_detail_cell :is(.horsepage_identity, .horsepage_stats_col) {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

@container content (max-width: 700px) {
    .stable_horse_list_col_sex { display: none; }
}

/* @container content (max-width: 650px) {
    .stable_horse_list_col_age { display: none; }
} */

@container content (max-width: 600px) {
    /* HIDE (off) */
    /* .stable_horse_list_col_last {
        display: none;
        width: 0 !important;
        padding: 0 !important;
        overflow: hidden;
    } */

    /* WIDTH */
    .stable_horse_list_col_age,
    .stable_horse_list_col_cap  { width: 40px; }
     .stable_horse_list_col_last,
    .stable_horse_list_col_r,
    .stable_horse_list_col_w    { width: 36px; }
}

@container content (max-width: 550px) {
    /* HIDE (off) */
    /* .stable_horse_list_col_quick {
        display: none;
        width: 0 !important;
        padding: 0 !important;
        overflow: hidden;
    }
    .stable_horse_list_table > thead > tr > th:first-child {
        width: 70%;
    } */

    /* WIDTH */
    .stable_horse_list_col_quick { width: 30px; }
}

@container content (max-width: 500px) {
    /* HIDE (off) */
    /* .stable_horse_list_col_status {
        display: none;
        width: 0 !important;
        padding: 0 !important;
        overflow: hidden;
    }
    .stable_horse_list_table > thead > tr > th:first-child {
        width: 90%;
    } */

    /* WIDTH */
    .stable_horse_list_col_status { width: 30px; }

    /* TEXT: compact cells (also covers 400px and under) */
    .stable_horse_list_table th,
    .stable_horse_list_table td {
        padding: 6px 6px;
    }
    .stable_horse_list_horse_name { font-size: 13px; }
}

/* Extra small: only what differs from the 500px rules above */
@container content (max-width: 400px) {
    /* TEXT */
    .stable_horse_list_table      { font-size: 11px; }
    .stable_horse_list_horse_name { font-size: 12px; }
    .re_horse_name_wrap           { font-size: 11px !important; }
}

/* =============================================================================
   delta_stable_notes.css
   Notes section inside stable list expanded row
   ============================================================================= */

.shl_notes_row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 6px;
}

.shl_notes_input {
  width: 100%;
  font-size: 13px;
  line-height: 1.5;
  padding: 6px 8px;
  border: 1px solid #cdd4dc;
  border-radius: 4px;
  resize: vertical;
  color: #334155;
  background: #fff;
  font-family: inherit;
}

.shl_notes_input:focus {
  outline: none;
  border-color: #6a9ec4;
  box-shadow: 0 0 0 2px rgba(106,158,196,0.15);
}

/* Feedback — shared with horsepage */
.hp_saveresult      { padding: 4px 10px; border-radius: 4px; font-size: 12px; margin: 0 10px 6px; }
.hp_saveresult_ok   { color: #2a6a2a; background: #eaf5ea; }
.hp_saveresult_fail { color: #8a1f1f; background: #fdeaea; }

.shl_notes_loading {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
  padding: 6px 2px;
}

/* Stable Horse List Styles - Properly Prefixed */
.gradient {
    background: var(--ehr-theme-gradient);
    /* background: var(--ehr-theme-raised); */
}

/* .stable_horse_info {
    display: grid;
    grid-template-columns: 5fr 2fr 2fr;
    gap: 1em;
    padding: 1em;
    width: 100% !important;
    max-width: 100% !important;
} */
/*.stable_horse_info > div:last-child {
  grid-column: span 3;
}*/
/* Desktop / tablet */
@container content (max-width: 600px) {

    /* .stable_horse_info {
        display: flex;
        flex-direction: column;
    } */

    /* Make Div3 and Div4 full width */
    /* .stable_horse_info > div:nth-child(3),
    .stable_horse_info > div:nth-child(4) {
        grid-column: span 2;
    } */

}

@container content (min-width: 800px) {
    .stable_horse_list_horse_details {
        display: none;
        color: var(--ehr-text-muted);
    }
}

/* Desktop / tablet */
@container content (max-width: 600px) {

    /* .stable_horse_info {
        display: flex;
        flex-direction: column;
    } */

    /* Make Div3 and Div4 full width */
    /* .stable_horse_info > div:nth-child(3),
    .stable_horse_info > div:nth-child(4) {
        grid-column: span 2;
    } */
}
/* WILLMERGE_20261017 (render R14): Will's #8a8a8a details line is 3.2:1 on the dark theme's #3b3b3b; the dark theme keeps the old grey */
[data-theme="dark"] .stable_horse_list_horse_details { color: #a9a9a9; }
/* WILLMERGE_20261108 (run list 607, render): the Health picture keeps its size on a phone (13x10 otherwise); the table still fits from 360px */
.stable_horse_list_col_quick img { max-width: none; }


.stable_horse_close_button {
  color: var(--ehr-theme-on-brand); /* WILLUI6_20261115: was --ehr-theme-base-text, a name that no longer exists */
  background: var(--ehr-theme-base); /* WILLUI6_20261115: the colour the button had (his edit was in a stray copy, never seen; strong made the red [x] hard to read) */
  padding: 3px 15px; 
  border-radius: 20px 20px 0 0; 
  text-decoration: none; 
  display: inline-block; 
  cursor: default;
}