/* ============================================================
   VETMED-PRO — Design System (identidade visual oficial)
   Paleta: Verde Profundo / Verde Petróleo / Azul Marinho /
           Teal Claro / Âmbar / Cinza Neutro
   Tipografia: Playfair Display (títulos) + Inter (interface)
   ============================================================ */
:root {
  /* paleta da marca */
  --green-deep:   #0F3D33;
  --green-petrol: #1F5C5A;
  --navy:         #0D1F37;
  --teal-light:   #6FB7B4;
  --amber:        #E8A23A;
  --neutral:      #F1F3F4;

  /* derivados */
  --green-700:    #15534a;
  --green-600:    #1d6b5f;
  --green-050:    #e9f2ef;
  --ink:          #14302b;
  --ink-2:        #3a4f4b;
  --muted:        #6a7c79;
  --bg:           #f2f5f4;
  --card:         #ffffff;
  --line:         #e3ebe8;
  --line-2:       #eef3f1;

  --amber-soft:   #fcefd6;
  --amber-ink:    #9a6512;
  --coral:        #e2574c;
  --coral-soft:   #fceae8;
  --coral-ink:    #b23b30;
  --navy-soft:    #e6ebf2;

  --shadow-xs: 0 1px 2px rgba(15,61,51,.05);
  --shadow:    0 1px 3px rgba(15,61,51,.06), 0 6px 20px -8px rgba(15,61,51,.10);
  --shadow-lg: 0 18px 50px -12px rgba(13,31,55,.28);
  --radius:   18px;
  --radius-sm:12px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: rgba(31,92,90,.22); }

/* ---------------- Layout ---------------- */
.app { display: grid; grid-template-columns: 276px 1fr; min-height: 100vh; }

/* ---------------- Sidebar ---------------- */
.sidebar {
  background: linear-gradient(185deg, var(--green-deep) 0%, #0b322b 100%);
  color: #d7e8e4;
  padding: 22px 14px 18px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 3px;
  border-right: 1px solid rgba(255,255,255,.05);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 10px; }

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; }
.brand .logo { width: 44px; height: 44px; flex-shrink: 0; filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.brand .logo svg { width: 100%; height: 100%; display: block; }
.brand h1 { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: -.2px; color: #fff; line-height: 1; }
.brand h1 b { color: var(--teal-light); font-weight: 700; }
.brand small { display: block; font-size: 10px; font-weight: 500; letter-spacing: .3px; color: #84b8b1; margin-top: 5px; }

.nav-label { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #6ba79e; padding: 16px 12px 8px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; color: #c4ddd8;
  font-size: 13.5px; font-weight: 500; width: 100%; text-align: left;
  transition: background .16s, color .16s; position: relative;
}
.nav-item .ico {
  font-size: 14px; width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 9px;
  background: rgba(255,255,255,.06); transition: background .16s;
}
.nav-item .count {
  margin-left: auto; font-size: 11px; font-weight: 600; min-width: 22px; text-align: center;
  background: rgba(255,255,255,.07); padding: 2px 8px; border-radius: 20px; color: #9ecfc7;
  transition: all .16s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item:hover .ico { background: rgba(255,255,255,.12); }
.nav-item.active { background: rgba(111,183,180,.14); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--amber);
}
.nav-item.active .ico { background: var(--amber); color: var(--green-deep); }
.nav-item.active .count { background: rgba(232,162,58,.2); color: #f3cd8f; }

.sidebar-footer { margin-top: auto; padding: 16px 12px 4px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-footer .slogan { font-family: var(--serif); font-size: 13.5px; font-style: italic; color: #bfe3dd; line-height: 1.45; }
.sidebar-footer .meta { font-size: 10.5px; color: #6ba79e; margin-top: 9px; line-height: 1.5; }

/* ---------------- Main ---------------- */
.main { display: flex; flex-direction: column; min-width: 0; position: relative; }

/* arte de fundo sutil */
.bg-art {
  position: fixed; inset: 0 0 0 276px; z-index: 0; pointer-events: none;
  color: var(--green-petrol); opacity: .04; overflow: hidden;
}
.bg-art svg { width: 100%; height: 100%; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(242,245,244,.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 14px 32px 12px; display: flex; flex-direction: column; gap: 13px;
}
.topbar-row { display: flex; align-items: center; gap: 14px; }
.search { flex: 1; max-width: 760px; position: relative; }
.search input {
  width: 100%; padding: 12px 16px 12px 46px;
  border: 1.5px solid var(--line); border-radius: 13px;
  font-size: 14.5px; background: var(--card); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: #93a5a2; }
.search input:focus { outline: none; border-color: var(--green-petrol); box-shadow: 0 0 0 4px rgba(31,92,90,.1); }
.search .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 16px; opacity: .45; }
.search .clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); padding: 5px 10px; border-radius: 8px; }
.search .clear:hover { background: var(--line); }

.tool-btn {
  padding: 11px 17px; border-radius: 12px; background: var(--green-deep); border: 1.5px solid var(--green-deep);
  font-weight: 600; font-size: 13.5px; color: #fff; display: flex; align-items: center; gap: 8px;
  transition: all .15s; white-space: nowrap;
}
.tool-btn:hover { background: var(--green-700); box-shadow: 0 8px 20px -8px rgba(15,61,51,.5); }

/* barra de espécies (chips) */
.species-bar { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; }
.species-bar::-webkit-scrollbar { height: 5px; }
.species-bar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; }
.sp-chip {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; flex-shrink: 0;
  padding: 7px 14px 7px 11px; border-radius: 30px; font-size: 13px; font-weight: 600;
  background: var(--card); border: 1.5px solid var(--line); color: var(--ink-2);
  transition: all .15s;
}
.sp-chip .sp-ico {
  font-size: 14px; line-height: 1; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 7px; background: var(--neutral); transition: background .15s;
}
.sp-chip:hover { border-color: var(--teal-light); }
.sp-chip.active { background: var(--green-deep); border-color: var(--green-deep); color: #fff; box-shadow: 0 6px 16px -6px rgba(15,61,51,.5); }
.sp-chip.active .sp-ico { background: rgba(255,255,255,.16); }
.sp-check { font-size: 11px; font-weight: 800; color: var(--amber); margin-left: 1px; }
.sp-div { width: 1px; height: 22px; background: var(--line); flex-shrink: 0; margin: 0 3px; }
.sp-div:last-child { display: none; }

.content { padding: 26px 32px 64px; max-width: 1280px; width: 100%; position: relative; z-index: 1; }

/* ---------------- Cabeçalho da página ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head-main h2 { font-family: var(--serif); font-size: 32px; font-weight: 700; letter-spacing: -.4px; color: var(--green-deep); line-height: 1.1; }
.page-head-main p { color: var(--muted); font-size: 14px; margin-top: 6px; font-weight: 500; }

/* indicadores (stat cards) */
.page-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(146px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-xs);
  transition: transform .15s, box-shadow .15s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; background: var(--green-050); color: var(--green-petrol); }
.stat-ico svg { width: 21px; height: 21px; }
.stat-num { font-size: 23px; font-weight: 800; color: var(--ink); line-height: 1; letter-spacing: -.5px; }
.stat-lbl { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 4px; line-height: 1.25; }
.stat.amber { background: linear-gradient(180deg,#fffaf0,#fef4e1); border-color: #f3dcae; }
.stat.amber .stat-ico { background: var(--amber); color: #fff; }
.stat.amber .stat-num { color: var(--amber-ink); }
.stat.navy .stat-ico { background: var(--navy-soft); color: var(--navy); }

/* ---------------- Aviso institucional ---------------- */
.notice {
  display: flex; gap: 15px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--green-petrol);
  border-radius: 14px; padding: 16px 20px; margin-bottom: 24px; box-shadow: var(--shadow-xs);
}
.notice .n-ico { width: 42px; height: 42px; flex-shrink: 0; border-radius: 11px; background: var(--green-050); color: var(--green-petrol); display: grid; place-items: center; }
.notice .n-ico svg { width: 22px; height: 22px; }
.notice h3 { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.notice p { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.notice p b { color: var(--green-700); font-weight: 600; }

/* ---------------- Grid de cards ---------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.drug-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 16px; cursor: pointer; box-shadow: var(--shadow-xs);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden;
}
.drug-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, var(--green-petrol)); }
.drug-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-class { font-size: 10.5px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .5px; display: flex; align-items: center; gap: 5px; }
.drug-card h3 { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: -.2px; line-height: 1.2; margin-top: 4px; color: var(--ink); }
.pharm { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.card-fav { font-size: 19px; line-height: 1; color: #cbd6d3; transition: color .15s, transform .15s; flex-shrink: 0; }
.card-fav:hover { color: var(--amber); transform: scale(1.12); }
.card-fav.on { color: var(--amber); }

.card-species { display: flex; flex-wrap: wrap; gap: 5px; }
.sp-dot {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 14px;
  background: var(--neutral); box-shadow: inset 0 0 0 1px var(--line);
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 10.5px; font-weight: 700; padding: 4px 10px; border-radius: 7px; letter-spacing: .2px; text-transform: uppercase; }
.tag-ctrl { background: transparent; color: var(--green-700); box-shadow: inset 0 0 0 1.3px #bcd9d2; }
.tag-warn { background: var(--amber-soft); color: var(--amber-ink); }
.tag-carc { background: var(--coral-soft); color: var(--coral-ink); }
.tag-new  { background: #e2f3ef; color: #15756a; }

.card-cta {
  margin-top: 2px; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--green-petrol);
  padding: 7px 0; transition: gap .15s, color .15s;
}
.card-cta span { transition: transform .15s; }
.drug-card:hover .card-cta { color: var(--green-deep); }
.drug-card:hover .card-cta span { transform: translateX(3px); }

/* ---------------- Estado vazio ---------------- */
.empty { text-align: center; padding: 70px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty .empty-art { width: 132px; height: 132px; color: var(--teal-light); opacity: .85; margin-bottom: 8px; }
.empty h3 { font-family: var(--serif); font-size: 22px; color: var(--green-deep); font-weight: 700; }
.empty p { font-size: 14px; max-width: 340px; line-height: 1.5; }
.empty-reset { margin-top: 12px; padding: 10px 20px; border-radius: 11px; background: var(--green-deep); color: #fff; font-weight: 600; font-size: 13.5px; transition: background .15s; }
.empty-reset:hover { background: var(--green-700); }

/* ---------------- Modal / monografia ---------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(13,31,55,.5); backdrop-filter: blur(5px);
  z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto;
}
.overlay.open { display: flex; }
.modal {
  background: var(--bg); border-radius: 22px; width: 100%; max-width: 940px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .24s cubic-bezier(.2,.9,.3,1.05);
}
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

.modal-head { padding: 28px 32px 24px; color: #fff; position: relative; }
.modal-head .close { position: absolute; top: 20px; right: 20px; z-index: 5; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; font-size: 18px; display: grid; place-items: center; transition: background .15s; }
.modal-head .close:hover { background: rgba(255,255,255,.32); }
.modal-head .mh-class { font-size: 11.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; opacity: .9; }
.modal-head h2 { font-family: var(--serif); font-size: 32px; font-weight: 700; letter-spacing: -.4px; margin: 5px 0 7px; }
.modal-head .mh-pharm { font-size: 14px; opacity: .94; font-weight: 500; }
.modal-head .mh-syn { font-size: 12.5px; opacity: .8; margin-top: 8px; font-style: italic; }
.modal-head .mh-badges { display: flex; gap: 8px; margin-top: 15px; flex-wrap: wrap; }
.mh-badge { font-size: 11.5px; font-weight: 600; padding: 5px 12px; border-radius: 20px; background: rgba(255,255,255,.16); color: #fff; }

.modal-body { padding: 26px 32px 36px; display: flex; flex-direction: column; gap: 24px; }

.alert-strong {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--coral-soft); border: 1px solid #f1b6b0; border-radius: 14px;
  padding: 15px 17px; color: var(--coral-ink); font-size: 13.5px; font-weight: 500;
}
.alert-strong .i { font-size: 19px; }

.sec h4 { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--green-petrol); margin-bottom: 11px; display: flex; align-items: center; gap: 8px; }
.sec h4::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.sec p { font-size: 14.5px; color: var(--ink-2); line-height: 1.62; }
.sec ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.sec ul li { font-size: 14px; color: var(--ink-2); padding-left: 22px; position: relative; line-height: 1.5; }
.sec ul li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 6px; height: 6px; border-radius: 2px; background: var(--teal-light); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.dose-table { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.dose-row { padding: 15px 17px; border-bottom: 1px solid var(--line); }
.dose-row:last-child { border-bottom: none; }
.dose-row .dr-top { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; flex-wrap: wrap; }
.sp-badge { font-size: 11.5px; font-weight: 700; padding: 3px 11px; border-radius: 8px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, white); white-space: nowrap; }
@supports not (background: color-mix(in srgb, red, white)) { .sp-badge { background: var(--green-050); } }
.dr-indic { font-size: 13px; font-weight: 600; color: var(--ink); }
.dr-dose { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--green-petrol); }
.dr-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.dr-meta b { color: var(--ink-2); font-weight: 600; }
.dr-obs { font-size: 12.5px; color: var(--muted); margin-top: 5px; font-style: italic; }

/* período de carência */
.carc-box {
  margin-top: 10px; padding: 10px 13px; border-radius: 11px;
  background: linear-gradient(180deg,#fff8ec,#fef3df); border: 1px solid #f0d9a8;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
}
.carc-tag { font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--amber-ink); background: #fbe6bf; padding: 4px 10px; border-radius: 20px; }
.carc-item { font-size: 12.5px; color: #6b4810; }
.carc-item b { color: #7a3f06; font-weight: 700; }

.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font-size: 12.5px; padding: 6px 12px; border-radius: 9px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); }

.info-line { display: flex; gap: 10px; font-size: 13.5px; color: var(--ink-2); padding: 10px 0; border-bottom: 1px dashed var(--line); }
.info-line:last-child { border: none; }
.info-line .k { font-weight: 700; color: var(--green-petrol); min-width: 140px; flex-shrink: 0; }

/* disclaimer (rodapé do modal) */
.disclaimer {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--green-050); border: 1px solid #cfe4df;
  border-radius: 13px; padding: 14px 16px; font-size: 13px; color: var(--green-700);
}
.disclaimer .i { font-size: 17px; }
.disclaimer b { color: var(--green-deep); }

/* ---------------- Calculadora ---------------- */
.calc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 6px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.field input, .field select { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 11px; font-size: 15px; background: var(--card); color: var(--ink); font-family: inherit; }
.field input:focus, .field select:focus { outline: none; border-color: var(--green-petrol); box-shadow: 0 0 0 4px rgba(31,92,90,.1); }
.calc-result { background: var(--green-050); border: 1px solid #bfe0d9; border-radius: 13px; padding: 16px; margin-top: 4px; }
.calc-result .big { font-family: var(--mono); font-size: 24px; font-weight: 800; color: var(--green-petrol); }
.calc-result .lbl { font-size: 12.5px; color: var(--green-700); font-weight: 600; }
.calc-result small { color: var(--muted); font-size: 12px; display: block; margin-top: 6px; }

/* ---------------- responsivo ---------------- */
.menu-btn { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); place-items: center; font-size: 18px; flex-shrink: 0; }
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 80; width: 276px; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: grid; }
  .bg-art { inset: 0; }
  .grid2 { grid-template-columns: 1fr; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(13,31,55,.45); z-index: 70; }
  .scrim.open { display: block; }
}
@media (max-width: 560px) {
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px 54px; }
  .page-head-main h2 { font-size: 26px; }
  .calc-fields { grid-template-columns: 1fr; }
  .modal-head h2 { font-size: 25px; }
  .modal-body { padding: 22px 18px 30px; }
}
