/* ════════════════════════════════════════════════════════════════════════
   HD SHARED DESIGN SYSTEM
   Spoločné štýly pre všetky stránky vo Voľná zóna → Hovädzí dobytok.
   Vzor: /hd/gen-hodnotenie-medzinarodne
   Trieda prefix: .hd-*
   ════════════════════════════════════════════════════════════════════════ */

/* ── LAYOUT ─────────────────────────────────────────────────────────────── */
.hd-main { display: flex; flex-direction: column; gap: 14px; }

/* ── FILTER CARD ─────────────────────────────────────────────────────────── */
.hd-filter-card {
    background: #fff; border-radius: 14px;
    border: 1.5px solid #dcedc8; padding: 14px 18px;
}

.hd-filter-top {
    display: flex; align-items: center; margin-bottom: 14px;
}

.hd-filter-lbl {
    font-size: 12px; font-weight: 700; color: #2e7d32;
    text-transform: uppercase; letter-spacing: 1px;
    display: flex; align-items: center; gap: 8px;
}

.hd-filter-dot { width: 8px; height: 8px; border-radius: 2px; background: #43a047; flex-shrink: 0; }

.hd-conv-link {
    margin-left: auto;
    color: #126dff; font-size: 12px; font-weight: 600;
    text-decoration: underline; text-underline-offset: 2px;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    border: none; background: none; font-family: inherit;
    padding: 0;
}
.hd-conv-link:hover { color: #0d47a1; }

/* fields */
.hd-field { display: flex; flex-direction: column; gap: 4px; }
.hd-field-label {
    font-size: 10px; color: #aaa; text-transform: uppercase;
    letter-spacing: .8px; font-weight: 700;
}

/* ── INPUTS ──────────────────────────────────────────────────────────────── */
.hd-input {
    height: 34px; border: 1.5px solid #dcedc8; border-radius: 8px;
    padding: 0 12px; font-size: 13px; color: #1a2a1a;
    font-family: inherit; background: #fff; width: 100%;
    outline: none; transition: border-color .12s;
    box-sizing: border-box;
}

.hd-input:focus        { border-color: #2e7d32; }
.hd-input::placeholder { color: #ccc; }

.hd-input-mono { font-variant-numeric: tabular-nums; font-weight: 600; }
.hd-input-sm   { width: 80px !important; flex-shrink: 0; }
.hd-input-md   { width: 140px !important; flex-shrink: 0; }
.hd-input-lg   { width: 220px !important; flex-shrink: 0; }
.hd-input-num  { width: 70px !important; text-align: center; flex-shrink: 0; }
.hd-input-date { width: 150px !important; flex-shrink: 0; }

.hd-select {
    appearance: none; padding-right: 28px;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%232e7d32' d='M5 6 0 0h10z'/></svg>") no-repeat right 10px center;
    cursor: pointer;
}

/* ── FILTER ROW (flex row of fields + buttons) ───────────────────────────── */
.hd-filter-row {
    display: flex; align-items: flex-end; flex-wrap: wrap;
    gap: 10px;
}
.hd-filter-row .hd-field { flex: 0 0 auto; }
.hd-filter-row .hd-select { min-width: 140px; }

.hd-filter-sub-row {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 10px; padding-top: 10px;
    border-top: 1px dashed #dcedc8; margin-top: 10px;
}

.hd-filter-sub-label {
    font-size: 11px; color: #5a8a5a;
    font-weight: 600; white-space: nowrap;
    text-transform: uppercase; letter-spacing: .5px;
}

.hd-filter-sub-group {
    display: flex; align-items: center; gap: 6px;
}

.hd-filter-sub-key {
    font-size: 11px; color: #5a8a5a; font-weight: 600;
    white-space: nowrap;
}

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.hd-btn-primary {
    height: 34px; padding: 0 18px; border-radius: 8px;
    font-size: 12px; font-weight: 600; cursor: pointer; border: none;
    font-family: inherit; background: #1b5e20; color: #fff;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .12s;
    white-space: nowrap;
}
.hd-btn-primary:hover { background: #246424; }
.hd-btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.hd-btn-secondary {
    height: 34px; padding: 0 18px; border-radius: 8px;
    font-size: 12px; font-weight: 700; cursor: pointer;
    border: 1.5px solid #dcedc8; font-family: inherit;
    background: #fff; color: #2e7d32; transition: all .12s;
    white-space: nowrap;
}
.hd-btn-secondary:hover { background: #f0f7f0; border-color: #a5d6a7; }
.hd-btn-secondary:disabled { opacity: .5; cursor: not-allowed; }

.hd-export-btn {
    height: 34px; padding: 0 12px;
    border: 1.5px solid #dcedc8; border-radius: 8px;
    background: #fff; color: #2e7d32; font-size: 12px; font-weight: 600;
    cursor: pointer; white-space: nowrap; font-family: inherit;
    transition: all .12s;
}
.hd-export-btn:hover:not(:disabled) { background: #f0f7f0; border-color: #a5d6a7; }
.hd-export-btn:disabled             { opacity: .5; cursor: not-allowed; }

/* toggle (on/off) — používané v Najlepšie kravy a inde */
.hd-btn-toggle {
    height: 28px; padding: 0 14px;
    border: none; border-radius: 14px;
    font-size: 11px; font-weight: 700; cursor: pointer;
    transition: background .12s, color .12s;
    white-space: nowrap; font-family: inherit;
}
.hd-btn-toggle-on  { background: #2e7d32; color: #fff; }
.hd-btn-toggle-off { background: #9e9e9e; color: #fff; }

.hd-msg-error { font-size: 12px; color: #c62828; margin-top: 6px; }

/* ── DATA CARD (table container) ─────────────────────────────────────────── */
.hd-data-card {
    background: #fff; border-radius: 14px;
    border: 1.5px solid #dcedc8; overflow: hidden;
}

.hd-data-card-head {
    background: #f0f7f0; border-bottom: 1px solid #dcedc8;
    padding: 10px 18px; display: flex; align-items: center;
    gap: 10px; font-size: 12px; color: #5a8a5a; flex-wrap: wrap;
}

.hd-data-card-head b { color: #1b5e20; font-weight: 700; }

.hd-dch-count {
    background: #2e7d32; color: #fff; border-radius: 10px;
    padding: 2px 9px; font-size: 10px; font-weight: 700;
}

.hd-breed-chip {
    display: inline-flex; align-items: center;
    background: #e8f5e8; color: #2e7d32;
    border: 1px solid #c8e6c9; border-radius: 20px;
    padding: 2px 10px; font-size: 11px; font-weight: 700;
}

.hd-dch-right { margin-left: auto; font-size: 11px; color: #5a8a5a; }
.hd-dch-right b { color: #1b5e20; font-weight: 700; }

/* info bar nad filter (info text) */
.hd-info-bar {
    background: #f0f7f0; border: 1.5px solid #dcedc8;
    border-radius: 8px; padding: 8px 14px;
    font-size: 12px; color: #2e7d32; font-weight: 600;
}

/* ── TABLE (apply Class="hd-table" on MudTable alebo na natívnej <table>) ─── */
.hd-table .mud-table-container { overflow-x: auto !important; }
.hd-table .mud-table { table-layout: auto !important; }

/* MudTable header */
.hd-table .mud-table-head th {
    background: #1b5e20 !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,.12) !important;
    cursor: pointer;
    transition: background .12s;
}

.hd-table .mud-table-head th:hover { background: #246424 !important; }
.hd-table .mud-sort-label-icon { color: rgba(255,255,255,.7) !important; }
.hd-table .mud-table-head .mud-table-sort-label,
.hd-table .mud-table-head .mud-table-sort-label-text {
    color: #fff !important;
}

.hd-table .mud-table-body td {
    padding: 8px 10px !important;
    white-space: nowrap; vertical-align: middle !important;
    font-size: 12px; font-variant-numeric: tabular-nums;
}

.hd-table .mud-table-body tr:hover { background: #f0f7f0 !important; }

/* Natívna <table class="hd-table"> — Ciselniky, Repro*, atď. */
table.hd-table {
    width: 100%; border-collapse: collapse; font-size: 12px;
}
table.hd-table thead th {
    background: #1b5e20;
    color: #fff;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
    padding: 8px 10px;
    text-align: left;
    border-right: 1px solid rgba(255,255,255,.12);
}
table.hd-table thead th:last-child { border-right: none; }
table.hd-table tbody td {
    padding: 7px 10px;
    color: #2a2a2a;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
table.hd-table tbody tr:hover td { background: #f0f7f0; }
table.hd-table tbody tr:nth-child(even) td { background: #fafffe; }
table.hd-table tbody tr:nth-child(even):hover td { background: #f0f7f0; }

/* helper triedy pre TH/TD */
.hd-th        { white-space: nowrap; }
.hd-th-left   { text-align: left !important; }
.hd-num       { text-align: right !important; }
.hd-unit      { display: block; font-size: 9px; opacity: .75; font-weight: 500; margin-top: 1px; }

.hd-th-divider { border-right: 1.5px solid rgba(255,255,255,.4) !important; }

/* TD helpers */
.hd-td {
    padding: 8px 10px !important;
    white-space: nowrap; vertical-align: middle !important;
    font-size: 12px; font-variant-numeric: tabular-nums;
}

.hd-td-divider { border-right: 1.5px solid #dcedc8 !important; }
.hd-td-left    { text-align: left !important; }
.hd-td-center  { text-align: center !important; }
.hd-td-num     { text-align: right !important; }
.hd-td-zero    { color: #ccc !important; }
.hd-td-mono    { font-family: monospace; font-size: 0.8rem; }

.hd-td-linia {
    text-align: left !important;
    color: #1a2a1a; font-weight: 700; letter-spacing: .3px;
}

.hd-td-reg {
    text-align: center !important;
    color: #5a8a5a; font-weight: 600;
}

.hd-td-meno {
    text-align: left !important;
    font-weight: 700; color: #1a2a1a;
    text-transform: uppercase; letter-spacing: .3px;
}

/* PH (genetické hodnoty) */
.hd-td-ph-pos  { text-align: right !important; color: #1b5e20; font-weight: 700; }
.hd-td-ph-neg  { text-align: right !important; color: #c62828; font-weight: 600; }
.hd-td-ph-zero { text-align: right !important; color: #ccc; }

/* country cell */
.hd-td-country { text-align: center !important; color: #5a8a5a; font-weight: 600; }

/* link v tabuľke (číslo zvieraťa) */
.hd-link-mono {
    color: #1b5e20 !important;
    font-family: monospace; font-size: 0.75rem; font-weight: 600;
    text-decoration: none;
}
.hd-link-mono:hover { text-decoration: underline; }

/* highlight pre top 3 (IML, IPH a pod.) */
.hd-td-top {
    font-weight: 700; color: #e65100;
    background: #fff8e1;
}

/* ── CHIPS / BADGES ──────────────────────────────────────────────────────── */
.hd-pl-chip {
    display: inline-block;
    min-width: 36px; padding: 2px 9px; border-radius: 5px;
    font-size: 10px; font-weight: 800;
    text-align: center; letter-spacing: .3px; color: #fff;
}

.hd-pl-chip-hol { background: #1565c0; color: #fff; }
.hd-pl-chip-hbr { background: #6a1b9a; color: #fff; }
.hd-pl-chip-si  { background: #e65100; color: #fff; }
.hd-pl-chip-def { background: #888;    color: #fff; }

.hd-gl-chip {
    display: inline-block;
    min-width: 28px; padding: 2px 8px; border-radius: 5px;
    font-size: 11px; font-weight: 800; color: #fff;
}
.hd-gl-A  { background: #1b5e20; }
.hd-gl-Bp { background: #43a047; }
.hd-gl-B  { background: #7cb342; }
.hd-gl-Bm { background: #ff9800; }
.hd-gl-C  { background: #c62828; }

/* reliability bar */
.hd-td-rel { white-space: nowrap; text-align: center !important; }

.hd-rel-bar-wrap {
    display: inline-block; width: 32px; height: 6px;
    background: #f0f0f0; border-radius: 3px;
    overflow: hidden; vertical-align: middle; margin-right: 6px;
}

.hd-rel-bar      { height: 100%; border-radius: 3px; display: block; }
.hd-rel-bar-low  { background: #f57f17; }
.hd-rel-bar-mid  { background: #43a047; }
.hd-rel-bar-high { background: #1b5e20; }

.hd-rel-pct { color: #1b5e20; font-weight: 700; font-size: 11px; }
.hd-rel-low { color: #e65100; }

/* ── PAGER STYLING for MudTablePager inside .hd-table ────────────────────── */
.hd-table .mud-table-pagination {
    background: #f0f7f0;
    border-top: 1px solid #dcedc8;
}
.hd-table .mud-table-pagination-toolbar {
    font-size: 12px;
    color: #5a8a5a;
}
