:root {
    --bg: #0f1419;
    --surface: #1a2332;
    --surface2: #243044;
    --text: #e8edf4;
    --muted: #8b9cb3;
    --accent: #3d9a5c;
    --accent-hover: #4db36e;
    --danger: #e05c5c;
    --border: #2d3a4f;
    --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-links a, .btn-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-links a:hover, .btn-link:hover { color: var(--accent); }
.nav-links .user { color: var(--text); font-weight: 500; }

.container { padding: 1.5rem; max-width: 1400px; margin: 0 auto; }

.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; margin-bottom: 0.25rem; }
.page-header p { color: var(--muted); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.farm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.farm-card h2 { font-size: 1.2rem; margin-bottom: 0.25rem; }
.farm-card p { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: #c0392b; color: #fff; border: 1px solid #a93226; }
.btn-danger:hover { background: #a93226; }

.features { margin-top: 2rem; }
.features h2 { margin-bottom: 0.75rem; }
.features ul { padding-left: 1.25rem; color: var(--muted); }
.features li { margin-bottom: 0.35rem; }
.features a { color: var(--accent); }

.empty-state {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--muted);
}

.empty-state pre {
    margin-top: 1rem;
    background: var(--bg);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    text-align: left;
    overflow-x: auto;
}

.auth-card {
    max-width: 400px;
    margin: 3rem auto;
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.auth-card h1 { margin-bottom: 1.5rem; }
.auth-card label { display: block; margin-bottom: 0.25rem; font-size: 0.85rem; color: var(--muted); }
.auth-card input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    margin-bottom: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
}

.auth-card .btn { width: 100%; margin-top: 0.5rem; }
.auth-card .hint { margin-top: 1rem; font-size: 0.8rem; color: var(--muted); }
.auth-card code { background: var(--bg); padding: 0.15rem 0.4rem; border-radius: 4px; }

.alert { padding: 0.75rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-error { background: rgba(224, 92, 92, 0.15); color: var(--danger); }

/* Map */
.map-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.toolbar-left { display: flex; align-items: center; gap: 1rem; }
.toolbar-left h1 { font-size: 1.25rem; }
.toolbar-left select, #move-paddock-select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-family: inherit;
}

.stocking-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.stocking-label { color: var(--muted); margin-right: 0.5rem; }
#module-ua { font-weight: 600; color: var(--accent); }

.side-panel {
    position: fixed;
    right: 1rem;
    top: 5rem;
    width: 300px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.side-panel.hidden { display: none; }
.side-panel h3 { margin-bottom: 0.75rem; }
.side-panel .detail { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
.side-panel .detail strong { color: var(--text); }
.panel-animals { margin-top: 0.75rem; font-size: 0.85rem; }
.panel-animal-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.panel-animal-list li {
    display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap;
    padding: 0.35rem 0.5rem; background: var(--surface-2); border-radius: 6px;
}
.panel-animal-list li span { flex: 1; min-width: 120px; }
.panel-animal-list .btn-sm { padding: 0.15rem 0.45rem; font-size: 0.72rem; }
.panel-actions { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.panel-actions label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; }
.panel-actions select { width: 100%; margin-bottom: 0.5rem; }
.panel-actions .btn { width: 100%; }

.btn-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface2);
    border: 1px solid var(--accent);
    color: var(--text);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    z-index: 2000;
    font-size: 0.9rem;
}

.toast.hidden { display: none; }
.toast.error { border-color: var(--danger); }

.leaflet-container { background: #1a2332; font-family: inherit; }

/* Leaflet Draw — vértices redondos, pequenos; linhas de guia normais */
.leaflet-editing-icon,
.leaflet-div-icon.leaflet-editing-icon,
.leaflet-draw-marker,
.leaflet-marker-icon.leaflet-draw-marker,
.leaflet-marker-icon.leaflet-editing-icon,
.map-draw-vertex {
    border-radius: 50% !important;
    width: 9px !important;
    height: 9px !important;
    margin-left: -4.5px !important;
    margin-top: -4.5px !important;
    border: 2px solid #fff !important;
    background: #3d9a5c !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
    box-sizing: border-box !important;
    background-image: none !important;
}
.leaflet-touch-icon.leaflet-editing-icon,
.leaflet-div-icon.leaflet-touch-icon {
    width: 14px !important;
    height: 14px !important;
    margin-left: -7px !important;
    margin-top: -7px !important;
}
.leaflet-draw-guide-dash {
    stroke: #3d9a5c !important;
    stroke-width: 2 !important;
    stroke-dasharray: 6, 6 !important;
    fill: none !important;
    opacity: 0.75 !important;
}
.leaflet-draw-tooltip {
    font-size: 0.75rem;
    padding: 0.2rem 0.45rem;
}

.map-point-icon {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.map-label-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(15, 20, 25, 0.85);
    color: var(--text);
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    line-height: 1.25;
    pointer-events: none;
}
.map-label-name {
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}
.map-label-area {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
}
.map-label span {
    background: rgba(15, 20, 25, 0.85);
    color: var(--text);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    border: 1px solid var(--border);
    pointer-events: none;
}
.map-label.module-label .map-label-inner { border-color: #4CAF50; }
.map-label.module-label .map-label-name { color: #8fd4a8; }
.map-label.paddock-label .map-label-name { font-size: 0.65rem; }
.map-label.paddock-label .map-label-area { font-size: 0.55rem; }
.map-label.module-label span { border-color: #4CAF50; color: #8fd4a8; }
.map-label.paddock-label span { font-size: 0.65rem; }
.map-label.cattle-label span { font-size: 0.6rem; opacity: 0.85; }

.map-dialog {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center; z-index: 1100;
    pointer-events: auto;
}
.map-dialog-card { width: 100%; max-width: 380px; padding: 1.25rem; }
.map-dialog-card h3 { margin-bottom: 1rem; }
.map-dialog .form-group { margin-bottom: 0.75rem; }
.map-dialog-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}
.map-dialog-tab {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}
.map-dialog-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.map-dialog-shape-hint { font-size: 0.85rem; line-height: 1.45; margin-bottom: 0.5rem; }
/* Modo polígono: painel lateral sem cobrir o mapa — mapa permanece clicável */
.map-dialog.shape-mode {
    inset: auto;
    right: 1rem;
    top: 5rem;
    left: auto;
    bottom: auto;
    width: 300px;
    height: auto;
    background: transparent;
    display: block;
    pointer-events: none;
}
.map-dialog.shape-mode .map-dialog-card {
    pointer-events: auto;
    max-width: 100%;
    margin: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* Vértices de edição acima das camadas do mapa */
body.map-vertex-edit-active .leaflet-marker-pane { z-index: 700 !important; }
body.map-vertex-edit-active .leaflet-overlay-pane { z-index: 650 !important; }

.paddock-tooltip {
    font-size: 0.8rem;
    line-height: 1.4;
}

.cattle-marker,
.lot-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    cursor: grab;
    position: relative;
}

.cattle-marker.male,
.lot-marker.male { background: #4a90d9; }
.cattle-marker.female,
.lot-marker.female { background: #d94a8a; }
.cattle-marker.dragging,
.lot-marker.dragging { cursor: grabbing; opacity: 0.7; }

.lot-marker .lot-emoji { font-size: 15px; line-height: 1; }
.lot-marker .lot-count {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #1a2332;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 1.5px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
    pointer-events: none;
}

.map-entity-popup { font-size: 0.85rem; line-height: 1.5; }
.map-entity-popup .map-edit-btn,
.map-entity-popup .map-delete-btn {
    display: block;
    width: 100%;
    margin-top: 0.4rem;
}

.paddock-module-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: rgba(76, 175, 80, 0.12);
}
.paddock-module-label {
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
}
.paddock-module-select {
    max-width: 220px;
    min-width: 160px;
}

/* Forms & tables */
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.btn-edit-cattle {
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    min-width: 110px;
    text-align: center;
}
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { text-align: center; padding: 1.25rem; }
.stat-value { display: block; font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.action-card { text-decoration: none; color: inherit; transition: border-color 0.2s; }
.action-card:hover { border-color: var(--accent); }
.action-card h2 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.action-card p { color: var(--muted); font-size: 0.85rem; }
.cattle-form { padding: 1.5rem; }
.form-section { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.form-section h2 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.25rem; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { font-size: 0.8rem; color: var(--muted); }
.form-control, .cattle-form select, .cattle-form input, .cattle-form textarea {
    background: var(--bg); border: 1px solid var(--border); color: var(--text);
    padding: 0.5rem 0.75rem; border-radius: 8px; font-family: inherit;
}
.form-actions { display: flex; gap: 0.75rem; margin-top: 1rem; }
.filter-bar { display: flex; gap: 0.75rem; flex-wrap: wrap; padding: 1rem; margin-bottom: 1rem; align-items: center; }
.filter-bar .form-control { min-width: 200px; flex: 1; }
.cattle-filter-form { margin-bottom: 1rem; padding: 0; overflow: hidden; }
.cattle-filter-form .filter-bar-main { margin-bottom: 0; }
.filter-advanced {
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--border);
}
.filter-advanced.hidden { display: none; }
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem 1rem;
    padding-top: 1rem;
}
.filter-field { display: flex; flex-direction: column; gap: 0.3rem; }
.filter-field label { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.filter-field-range .range-inputs { display: flex; align-items: center; gap: 0.4rem; }
.filter-field-range .range-inputs .form-control { flex: 1; min-width: 0; }
.range-sep { font-size: 0.8rem; color: var(--muted); flex-shrink: 0; }
.filter-hint { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }
.table-wrap { overflow-x: auto; padding: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th, .data-table td { padding: 0.65rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--muted); font-weight: 500; background: var(--bg); }
.data-table tr:hover { background: rgba(61, 154, 92, 0.05); }
.empty-cell { text-align: center; color: var(--muted); padding: 2rem !important; }
.pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1rem; color: var(--muted); }
.import-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.import-form .form-group { margin-bottom: 1rem; }
.checkbox-group { flex-direction: row; align-items: center; gap: 0.5rem; }
.import-result { margin-bottom: 1.5rem; }
.row-ok td { color: #8fd4a8; }
.row-error td { color: var(--danger); }
.column-list { padding-left: 1.25rem; color: var(--muted); line-height: 1.8; }

/* Cattle list selection & detail */
.list-tabs { margin-bottom: 1rem; padding: 0.5rem 1rem; }
.tab-bar { display: flex; gap: 0.25rem; flex-wrap: wrap; padding: 0.5rem; margin-bottom: 1rem; }
.tab-link {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: default;
}
.tab-link.active { background: var(--accent); color: #fff; }
.tab-link.tab-ready { cursor: pointer; color: var(--text); background: var(--surface2); }
.tab-link.tab-ready:hover { background: var(--accent); color: #fff; }
.tab-link.tab-disabled { opacity: 0.45; }

.selection-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-color: var(--accent);
    background: rgba(61, 154, 92, 0.08);
}
.selection-bar.hidden { display: none; }
.selection-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; margin: 0; }
.header-actions .inline-form { display: inline-flex; }
.bulk-edit-card { max-width: 720px; width: 100%; max-height: 90vh; overflow-y: auto; }
.bulk-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem 1rem;
    margin: 1rem 0;
}
.bulk-edit-warning {
    color: #e8b86d;
    font-size: 0.85rem;
    margin: 0.5rem 0 0;
}
.bulk-edit-warning.hidden { display: none; }
.parents-cell a { color: var(--accent); text-decoration: none; }
.parents-cell a:hover { text-decoration: underline; }

.col-select { width: 2.5rem; text-align: center; }
.cattle-select-table input[type="radio"],
.cattle-select-table input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }
.selection-actions .btn.hidden { display: none; }
.cattle-row { cursor: pointer; }
.cattle-row:has(input:checked) { background: rgba(61, 154, 92, 0.12) !important; }
.uid-link { color: var(--accent); text-decoration: none; }
.uid-link:hover { text-decoration: underline; }
.clickable-row { cursor: pointer; }

.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.25rem; }
.breadcrumb a { color: var(--accent); text-decoration: none; }

.detail-hero { margin-bottom: 1rem; }
.detail-hero-main { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.cattle-photo {
    width: 120px;
    height: 120px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 1px solid var(--border);
}
.cattle-photo.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: var(--bg);
}
.detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    flex: 1;
}
.mini-stat { text-align: center; padding: 0.75rem; background: var(--bg); border-radius: 8px; }
.mini-stat-value { display: block; font-size: 1.35rem; font-weight: 700; color: var(--accent); }
.mini-stat-label { font-size: 0.75rem; color: var(--muted); }

.detail-section { margin-bottom: 1rem; }
.detail-section h2 { font-size: 1rem; color: var(--accent); margin-bottom: 0.75rem; }
.detail-section h3 { font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--muted); }
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem 1.5rem;
}
.detail-grid div { display: flex; flex-direction: column; gap: 0.15rem; }
.detail-grid dt { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.detail-grid dd { font-size: 0.95rem; }
.detail-grid dd small { color: var(--muted); }

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}
.badge-active { background: rgba(61, 154, 92, 0.2); color: #8fd4a8; }
.badge-sold { background: rgba(139, 156, 179, 0.2); color: var(--muted); }
.badge-dead { background: rgba(224, 92, 92, 0.2); color: var(--danger); }
.badge-transferred { background: rgba(74, 144, 217, 0.2); color: #8ab4f0; }
.badge-missing { background: rgba(217, 74, 138, 0.2); color: #f0a0c8; }

.highlight-value { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.highlight-value small { display: block; font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.muted { color: var(--muted); font-size: 0.9rem; }
.empty-inline { color: var(--muted); padding: 1rem 0; }
.notes-block { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.notes-block p { color: var(--muted); font-size: 0.9rem; }

.genealogy-parents {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.parent-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}
.parent-card h3 { color: var(--accent); margin-bottom: 0.5rem; }
.parent-name { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.75rem; }
.parent-name a { color: var(--text); text-decoration: none; }
.parent-name a:hover { color: var(--accent); }
.parent-meta { display: grid; gap: 0.35rem; }
.parent-meta div { display: flex; gap: 0.5rem; font-size: 0.85rem; }
.parent-meta dt { color: var(--muted); min-width: 3.5rem; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.hidden { display: none !important; }

/* Brete */
.brete-home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.brete-continue-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    border-color: var(--accent);
    background: rgba(61, 154, 92, 0.1);
}
.brete-session-form .form-group { margin-bottom: 1rem; }
.session-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.session-info { display: flex; flex-direction: column; gap: 0.15rem; }
.brete-recent { margin-top: 1rem; }

.brete-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
}
.brete-toolbar-left { display: flex; align-items: center; gap: 1rem; }
.brete-toolbar-left h1 { font-size: 1.25rem; margin: 0; }
.brete-toolbar-right { display: flex; align-items: center; gap: 0.75rem; }
.brete-status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--surface2);
    color: var(--muted);
}
.brete-status-found { background: rgba(61, 154, 92, 0.2); color: #8fd4a8; }
.brete-status-new { background: rgba(74, 144, 217, 0.2); color: #8ab4f0; }

/* Mockup layout */
.brete-mockup-grid {
    display: grid;
    grid-template-columns: 90px 1fr minmax(200px, 28%);
    gap: 0.75rem;
    align-items: stretch;
    margin-bottom: 1.5rem;
}
@media (max-width: 1000px) {
    .brete-mockup-grid { grid-template-columns: 1fr; }
}

.brete-back-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
}
.brete-back-btn {
    flex: 1;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 2px solid var(--text);
    border-radius: 4px;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    padding: 0.5rem;
}
.brete-back-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--surface2); }
.brete-back-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.brete-back-arrow { font-size: 4rem; line-height: 0.8; font-weight: 300; }
.brete-back-label { font-size: 0.65rem; text-align: center; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.4; }

.brete-center-col { display: flex; flex-direction: column; gap: 0.75rem; }

.brete-top-id-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 340px;
}
.brete-wire-box {
    border: 2px solid var(--text);
    border-radius: 4px;
    background: var(--surface);
    padding: 0.5rem 0.75rem;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.brete-wire-box label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text);
    margin-bottom: 0.15rem;
}
.brete-wire-input {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    padding: 0;
}

.brete-hero-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    max-width: 420px;
    margin: 0.5rem auto 0;
    width: 100%;
}
.brete-hero-box { width: 100%; padding: 1.25rem 1rem; text-align: center; }
.brete-brand-box { width: 70%; padding: 0.75rem 1rem; text-align: center; }
.brete-weight-box { width: 85%; padding: 1rem; text-align: center; }

.brete-hero-input, .brete-brand-input {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text);
    text-align: center;
    font-family: inherit;
    font-weight: 800;
    outline: none;
}
.brete-visual-composite {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.1rem;
    width: 100%;
}
.brete-visual-prefix {
    font-size: 4rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    user-select: none;
}
.brete-visual-prefix.hidden { display: none; }
.brete-visual-composite.has-prefix .brete-visual-input { flex: 0 1 auto; min-width: 3ch; }
.brete-visual-hint {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.68rem;
    color: var(--muted);
}
.brete-hero-box .brete-hero-input { font-size: 4rem; line-height: 1; }
.brete-brand-input { font-size: 2rem; letter-spacing: 0.2em; }
.brete-weight-input { font-size: 3.5rem; color: var(--accent); }
.brete-hero-label {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: lowercase;
}

.brete-chart-col {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--text);
    border-radius: 4px;
    min-height: 200px;
}
.brete-chart-col h3 {
    font-size: 0.8rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.brete-chart-wrap {
    flex: 1;
    height: 80px;
    max-height: 80px;
    position: relative;
}
.brete-chart-empty { text-align: center; padding: 1rem 0; font-size: 0.8rem; }

.brete-side-panels {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
@media (max-width: 700px) {
    .brete-side-panels { grid-template-columns: 1fr; }
}

.brete-vaccines-panel h3, .brete-pregnancy-panel h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}
.brete-vaccine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.25rem 0.5rem;
    margin-bottom: 0.5rem;
    max-height: 120px;
    overflow-y: auto;
}
.brete-vaccine-check {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    cursor: pointer;
}
.brete-vaccine-check input { accent-color: var(--accent); }
.brete-add-vaccine { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.brete-add-vaccine input { flex: 1; min-width: 140px; }

.brete-pregnancy-options { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.brete-pregnancy-option {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.6rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}
.brete-pregnancy-option input { accent-color: var(--accent); }
.brete-pregnancy-hidden { opacity: 0.4; pointer-events: none; }

.brete-details-panel { padding: 0; overflow: hidden; }
.brete-details-panel summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--accent);
    list-style: none;
    font-size: 0.9rem;
}
.brete-details-panel summary::-webkit-details-marker { display: none; }
.brete-details-panel[open] summary { border-bottom: 1px solid var(--border); }
.brete-details-grid { padding: 0.75rem 1rem 1rem; }

.brete-rec-row {
    display: flex;
    justify-content: center;
    padding: 1rem 0 0.25rem;
}
.brete-rec-btn {
    min-width: 180px;
    padding: 0.85rem 2.5rem;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--text);
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s;
}
.brete-rec-btn:hover { border-color: var(--accent); background: rgba(61, 154, 92, 0.15); }
.brete-rec-btn:disabled { opacity: 0.5; cursor: wait; }

.brete-records-table-section { margin-top: 1rem; }
.brete-table-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.brete-table-header h2 { font-size: 1.1rem; }
.brete-table-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.brete-table-controls label { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.brete-table-controls .form-control { min-width: 120px; font-size: 0.85rem; padding: 0.35rem 0.5rem; }
.brete-records-table { font-size: 0.8rem; }
.brete-table-row { cursor: pointer; }
.brete-table-row:hover { background: rgba(61, 154, 92, 0.08); }
.brete-row-active { background: rgba(61, 154, 92, 0.15) !important; }