/* ============================================
   CropSaga - Animale & pășunat
   Stiluri dedicate modulului zootehnic (overview, efective,
   plan pășunat, hartă, feedlot). Folosește tokenii temei.
   ============================================ */

.an-page { padding: 18px 22px 60px; }
.an-page .module-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.an-page .module-header h1 { font-size: 1.5rem; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.an-sub { color: var(--color-text-secondary); font-size: .85rem; margin: 0; }
.an-sub-h { margin: 14px 0 8px; font-size: .95rem; }

/* Desktop: titlul e deja în meniul din stânga — nu-l dubla în conținut */
@media (min-width: 1024px) {
  body.app-shell[data-router-module="animals"] .an-page > .module-header > div:first-child:has(> h1),
  body.app-shell[data-router-module="animals-plan"] .an-page > .module-header > div:first-child:has(> h1),
  body.app-shell[data-router-module="animals-efective"] .an-page > .module-header > div:first-child:has(> h1),
  body.app-shell[data-router-module="animals-feedlot"] .an-page > .module-header > div:first-child:has(> h1) {
    display: none !important;
  }
}

/* ---- KPI ---- */
.an-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.an-kpi-2 { grid-template-columns: repeat(2, 1fr); }
.an-kpi-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.an-kpi {
    display: flex; align-items: center; gap: 12px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow);
}
.an-kpi-ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; flex-shrink: 0; }
.an-kpi-val { font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.an-kpi-lbl { font-size: .78rem; color: var(--color-text-secondary); }

/* ---- Cards / layout ---- */
.an-card { margin-bottom: 18px; }
.an-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1023px) { .an-cols { grid-template-columns: 1fr; } }

/* ---- Balanță ---- */
.an-bal-row { display: grid; grid-template-columns: 160px 1fr 70px; align-items: center; gap: 10px; margin-bottom: 10px; }
.an-bal-lbl { font-size: .82rem; color: var(--color-text-secondary); }
.an-bal-track { height: 12px; background: var(--card2); border-radius: 8px; overflow: hidden; }
.an-bal-fill { height: 100%; border-radius: 8px; transition: width .4s ease; }
.an-bal-val { font-size: .82rem; font-weight: 600; text-align: right; }
.an-bal-verdict { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; font-size: .85rem; margin-top: 8px; }
.an-bal-verdict.ok { background: rgba(39,174,96,.15); color: #2ecc71; }
.an-bal-verdict.bad { background: rgba(192,57,43,.15); color: #e74c3c; }
.an-bal-cov { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; font-size: .8rem; margin-top: 8px; color: var(--color-text-secondary); }
.an-bal-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 10px; }
.an-bal-mini { background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.an-bal-mini span { font-size: .72rem; color: var(--color-text-secondary); }
.an-bal-mini b { font-size: 1.05rem; }
.an-bal-mini.ok b { color: #2ecc71; }
.an-bal-mini.bad b { color: #e74c3c; }

/* ---- Ciclu de viață pipeline (overview) ---- */
.an-life { display: flex; flex-direction: column; gap: 4px; }
.an-life-stage { display: flex; align-items: center; gap: 12px; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.an-life-ic { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; }
.an-life-body { flex: 1; }
.an-life-top { display: flex; justify-content: space-between; font-size: .85rem; }
.an-life-arrow { text-align: center; color: var(--color-text-secondary); font-size: .8rem; }

/* ---- Hint ---- */
.an-hint { font-size: .78rem; color: var(--color-text-secondary); margin: 8px 0 0; line-height: 1.5; }

/* ---- Tables ---- */
.an-table-wrap { overflow-x: auto; }
.an-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.an-table thead th { text-align: left; padding: 10px 12px; color: var(--color-text-secondary); font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
.an-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.an-table tbody tr:hover { background: var(--color-hover-bg); }
.an-table-sm td { padding: 6px 8px; }
.an-table .hi td { background: rgba(148,201,115,.12); }
.an-empty-row { text-align: center; color: var(--color-text-secondary); padding: 24px !important; }
.an-empty-row i { margin-right: 6px; }

/* ---- Toolbar / tabs ---- */
.an-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.an-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.an-tab { background: none; border: none; padding: 10px 16px; color: var(--color-text-secondary); cursor: pointer; font-size: .88rem; border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 8px; }
.an-tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

/* ---- Badges ---- */
.an-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; color: #fff; font-size: .72rem; font-weight: 600; }

/* ---- Action buttons in tables ---- */
.an-actions-cell { white-space: nowrap; text-align: right; }
.btn-icon { background: var(--card2); border: 1px solid var(--border); color: var(--text); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; margin-left: 4px; }
.btn-icon:hover { background: var(--color-hover-bg); }
.btn-icon.danger:hover { background: rgba(192,57,43,.2); color: #e74c3c; border-color: #e74c3c; }
.btn-sm { padding: 5px 10px !important; font-size: .78rem !important; }

/* ---- Empty state ---- */
.an-empty { text-align: center; padding: 30px 10px; color: var(--color-text-secondary); }
.an-empty i { font-size: 2rem; opacity: .5; display: block; margin-bottom: 10px; }

/* ---- Quick links ---- */
.an-quicklinks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 4px; }
.an-quick { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: transform .15s, border-color .15s; }
.an-quick:hover { transform: translateY(-2px); border-color: var(--accent); }
.an-quick > i { font-size: 1.3rem; color: var(--accent); margin-bottom: 4px; }
.an-quick-t { font-weight: 600; }
.an-quick-s { font-size: .76rem; color: var(--color-text-secondary); }

/* ---- Forms in modals ---- */
.an-form .form-group { margin-bottom: 12px; }
.an-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .an-form-row { grid-template-columns: 1fr; } }
.an-modal { max-width: 560px; width: 92%; }
.an-modal-wide { max-width: 680px; }
.form-label small { color: var(--color-text-secondary); font-weight: 400; }

/* ---- Calc box (plan) ---- */
.an-calc-box { background: var(--card2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-top: 6px; }
.an-calc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.an-calc-grid > div { display: flex; flex-direction: column; }
.an-calc-grid span { font-size: .72rem; color: var(--color-text-secondary); }
.an-calc-grid b { font-size: 1.05rem; }
.an-calc-grid .hi b { color: var(--accent); }

/* ---- Weight history ---- */
.an-weight-history { max-height: 180px; overflow-y: auto; }
.an-weight-row { display: flex; justify-content: space-between; padding: 6px 8px; border-bottom: 1px solid var(--border); font-size: .85rem; }

/* ---- Lifecycle timeline (individual animal) ---- */
.an-lifetimeline { position: relative; margin: 10px 0 0 6px; padding-left: 18px; }
.an-lifetimeline::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.an-life-item { position: relative; padding: 8px 0; }
.an-life-dot { position: absolute; left: -18px; top: 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--card2); border: 2px solid var(--border); }
.an-life-item.done .an-life-dot { background: var(--accent); border-color: var(--accent); }
.an-life-item.next .an-life-dot { background: #E67E22; border-color: #E67E22; box-shadow: 0 0 0 4px rgba(230,126,34,.25); }
.an-life-title { font-weight: 600; font-size: .88rem; }
.an-life-meta { font-size: .76rem; color: var(--color-text-secondary); }

/* ---- Lifecycle bar (feedlot template) ---- */
.an-lifebar { display: flex; align-items: stretch; flex-wrap: wrap; gap: 6px; }
.an-lifebar-step { flex: 1; min-width: 110px; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 8px; text-align: center; }
.an-lifebar-badge { display: inline-block; background: var(--accent); color: #10240f; font-weight: 700; padding: 2px 10px; border-radius: 20px; font-size: .8rem; }
.an-lifebar-name { font-size: .8rem; margin-top: 6px; font-weight: 600; }
.an-lifebar-days { font-size: .72rem; color: var(--color-text-secondary); }
.an-lifebar-arrow { display: flex; align-items: center; color: var(--color-text-secondary); }
@media (max-width: 700px) { .an-lifebar-arrow { display: none; } }

/* ---- Gantt ---- */
.an-gantt { display: flex; flex-direction: column; gap: 4px; }
.an-gantt-row, .an-gantt-axis { display: grid; grid-template-columns: 160px 1fr; align-items: center; gap: 8px; }
.an-gantt-label { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text-secondary); }
.an-gantt-track { position: relative; height: 22px; background: var(--card2); border-radius: 6px; }
.an-gantt-axis .an-gantt-track { height: 18px; background: none; }
.an-gantt-mon { position: absolute; top: 0; font-size: .68rem; color: var(--color-text-secondary); transform: translateX(-50%); }
.an-gantt-bar { position: absolute; top: 3px; height: 16px; border-radius: 5px; color: #fff; font-size: .64rem; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* ---- Lot card (harta panel) ---- */
.an-lot-card { background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.an-lot-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.an-lot-top span { font-size: .74rem; color: var(--color-text-secondary); }
.an-lot-loc { font-size: .78rem; color: var(--color-text-secondary); margin: 4px 0 8px; }

/* ---- Harta layout & toolbar ---- */
/* Full-bleed sub top bar (ca harta fermă): fără spațiu gol sus */
body.app-shell[data-router-module="animals-harta"] main#routerView.content-center {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  max-width: none !important;
  width: 100% !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box;
}
.animals-harta-full.an-page,
.animals-harta-full {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  display: flex !important;
  flex-direction: row;
  align-items: stretch;
  flex: 1 1 0% !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  gap: 0;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden;
  box-sizing: border-box;
}
.map-container-animals {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}
#mapAnimals { position: absolute; inset: 0; }

.animals-status-panel {
  flex: 0 0 340px;
  width: 340px;
  min-width: 340px;
  max-width: 340px;
  background: var(--card, #fff);
  border-left: 1px solid var(--border, rgba(0,0,0,.12));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2;
  box-sizing: border-box;
}
.animals-status-panel .panel-header {
  flex: 0 0 auto;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,.12));
}
.animals-status-panel .panel-header h2 {
  font-size: 1.05rem;
  margin: 0 0 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.25;
}
.animals-status-panel .panel-subtitle {
  font-size: .76rem;
  color: var(--color-text-secondary);
  margin: 0;
}
.animals-status-panel .panel-content,
.animals-status-panel #anInfraPanel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 14px;
  display: block !important;
  float: none !important;
  columns: auto !important;
  column-count: 1 !important;
  grid-template-columns: none !important;
  writing-mode: horizontal-tb !important;
}
.animals-status-panel .an-infra-section {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  clear: both;
}
.animals-status-panel .an-infra-section h4 {
  display: block;
  width: 100%;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-text-secondary);
  margin: 0 0 8px;
}
.animals-status-panel .an-infra-item {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--card2, #f5f5f5);
  border: 1px solid var(--border, rgba(0,0,0,.1));
  margin-bottom: 6px;
  font-size: .82rem;
  position: relative;
  float: none !important;
}
.animals-status-panel .an-infra-item > i {
  flex: 0 0 18px;
  width: 18px;
  text-align: center;
}
.animals-status-panel .an-infra-item > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.animals-status-panel .an-infra-item > .btn-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin-left: auto;
}
.animals-status-panel .an-hint {
  display: block;
  width: 100%;
  margin: 0;
  font-size: .78rem;
  line-height: 1.4;
  color: var(--color-text-secondary);
  white-space: normal;
}
.animals-status-panel .an-amp-group {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
}
.animals-status-panel .an-lot-card {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

/* Layout mobil detaliat în app-small-screens.css (full-bleed, fără bandă goală sus) */
@media (max-width: 1023px) {
  .animals-harta-full.an-page,
  .animals-harta-full { flex-direction: column; height: auto; min-height: 0; padding: 0; }
  .animals-status-panel {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

.an-map-toolbar { position: absolute; top: 12px; left: 12px; z-index: 500; display: flex; flex-direction: column; gap: 8px; }
.an-map-group { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 6px; display: flex; align-items: center; gap: 4px; box-shadow: var(--shadow); flex-wrap: wrap; max-width: 260px; }
.an-map-group-lbl { font-size: .68rem; color: var(--color-text-secondary); padding: 0 4px; width: 100%; }
.an-map-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--card2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.an-map-btn:hover { background: var(--color-hover-bg); }
.an-map-btn.active { border-color: var(--accent); background: rgba(148,201,115,.2); }
.an-map-btn-water { cursor: grab; }
.an-map-btn-water.dragging { opacity: .55; cursor: grabbing; }
.an-map-btn-water:active { cursor: grabbing; }
.an-shade-poly { cursor: pointer; }
.leaflet-editing-icon { border-radius: 50%; background: #27AE60 !important; border: 2px solid #fff !important; }
.an-place-hint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 500; background: rgba(0,0,0,.8); color: #fff; padding: 8px 16px; border-radius: 20px; font-size: .82rem; }
.an-place-hint.hidden, .hidden { display: none !important; }

.an-infra-section { margin-bottom: 16px; }
.an-infra-section h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-secondary); margin: 0 0 8px; }
.an-infra-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--card2); border: 1px solid var(--border); margin-bottom: 6px; font-size: .82rem; }
.an-infra-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.an-amp-group { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: var(--card2); }
.an-amp-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: .82rem; font-weight: 600; }
.an-amp-group-head span { flex: 1; min-width: 0; }
.an-amp-task { border-color: rgba(22, 160, 133, 0.35); background: var(--card, #fff); }
.an-amp-task-meta {
  font-size: .74rem;
  color: var(--color-text-secondary);
  line-height: 1.35;
  margin: 0 0 8px;
}
.an-amp-task-when { opacity: .8; }
.an-infra-tasks h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #16A085 !important;
}
.an-amp-subgroup-lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-secondary); margin: 8px 0 4px; }
.an-amp-strip-item { background: transparent; border-style: dashed; border-color: rgba(41, 128, 185, 0.45); }
.an-amp-lane-item {
  border-style: solid;
  border-color: rgba(26, 188, 156, 0.55);
  background: rgba(72, 201, 176, 0.12);
  font-weight: 500;
}
.an-amp-perm-item { border-style: solid; border-color: #111; }

.an-parcel-popup .an-amp-split-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    text-align: center;
}

.an-amp-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
@media (min-width: 1024px) {
  .an-amp-dialog-overlay { align-items: center; }
}
.an-amp-dialog {
    width: min(440px, 100%);
    max-height: min(92vh, 720px);
    overflow-y: auto;
    background: var(--card, #fff);
    border: 1px solid var(--border, #ddd);
    border-radius: 14px;
    padding: 18px 16px 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.an-amp-dialog h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.an-amp-dialog-sub {
    margin: 0 0 14px;
    font-size: .82rem;
    color: var(--color-text-secondary);
}
.an-amp-warn { color: #C0392B; font-weight: 600; }
.an-amp-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    font-size: .82rem;
}
.an-amp-field em { font-style: normal; font-weight: 400; opacity: .7; }
.an-amp-field-row {
    display: flex;
    gap: 10px;
}
.an-amp-field-half { flex: 1; min-width: 0; }
.an-amp-field input,
.an-amp-field select {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card2, #f7f7f7);
    font-size: 1rem;
    box-sizing: border-box;
    width: 100%;
}
.an-amp-field small { color: var(--color-text-secondary); font-size: .72rem; }
.an-amp-util-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.an-amp-util-row input[type="range"] { flex: 1; }
.an-amp-util-row output {
    min-width: 3.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.an-amp-calc {
    background: var(--card2, #f4f4f4);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: .78rem;
    line-height: 1.45;
}
.an-amp-calc-steps { margin-top: 6px; }
.an-amp-calc-row { margin: 3px 0; color: var(--color-text-secondary); }
.an-amp-calc-row b { color: var(--color-text, #222); font-weight: 600; }
.an-amp-calc-note {
    display: block;
    font-size: .7rem;
    opacity: .85;
    margin-top: 1px;
}
.an-amp-calc-result { margin-top: 8px; color: var(--color-text, #222); }

/* Take half / leave half bar */
.an-amp-takehalf { margin-bottom: 8px; }
.an-amp-takehalf-bar {
    display: flex;
    height: 22px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.an-amp-takehalf-take {
    background: #2E7D4F;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 0;
}
.an-amp-takehalf-leave {
    background: #C8E6C9;
    color: #1B4332;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 0;
}
.an-amp-takehalf.is-risk .an-amp-takehalf-take { background: #C0392B; }
.an-amp-takehalf.is-risk .an-amp-takehalf-leave { background: #F5D0C8; color: #6B2A22; }
.an-amp-takehalf-lbl {
    margin-top: 4px;
    font-size: .68rem;
    color: var(--color-text-secondary);
}

/* Stock density gauge */
.an-amp-density-gauge { margin: 4px 0 8px; }
.an-amp-density-track {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3px;
    margin-bottom: 4px;
}
.an-amp-density-cell {
    text-align: center;
    padding: 5px 2px;
    border-radius: 5px;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .45;
    border: 1px solid transparent;
}
.an-amp-density-low { background: #E8F5E9; color: #2E7D32; }
.an-amp-density-med { background: #FFF8E1; color: #F57F17; }
.an-amp-density-high { background: #FFEBEE; color: #C62828; }
.an-amp-density-cell.is-active {
    opacity: 1;
    border-color: currentColor;
    box-shadow: inset 0 0 0 1px currentColor;
}
.an-amp-density-vals {
    font-size: .75rem;
    font-weight: 600;
    color: var(--color-text, #222);
}

/* Root risk warning */
.an-amp-root-warn {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 8px 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #FDECEA;
    border: 1px solid #F5C6CB;
    color: #6B2A22;
    font-size: .74rem;
    line-height: 1.35;
}
.an-amp-root-icon {
    width: 36px;
    height: 30px;
    flex-shrink: 0;
}
.an-amp-count-field span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.an-amp-auto-btn {
    border: 1px solid var(--border, #ccc);
    background: var(--card2, #f4f4f4);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    color: #16A085;
}
.an-amp-auto-btn:hover { background: #E8F8F5; }

.an-amp-dialog-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}
.an-amp-dialog-actions .btn-primary,
.an-amp-dialog-actions .btn-secondary {
    min-height: 40px;
    padding: 8px 14px;
}
