:root{color-scheme:light;--bg:#f3f6f3;--surface:#fff;--surface2:#edf4ee;--text:#193329;--muted:#64756c;--line:#dce5de;--green:#167354;--green2:#10593f;--danger:#ad3838;--shadow:0 5px 22px #183d2410;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:15px}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){color-scheme:dark;--bg:#111a16;--surface:#1c2822;--surface2:#23362c;--text:#eef5ef;--muted:#a6b9ac;--line:#34483b;--green:#51bc8e;--green2:#309a6d;--danger:#ee8a8a;--shadow:none}}
:root[data-theme=dark]{color-scheme:dark;--bg:#111a16;--surface:#1c2822;--surface2:#23362c;--text:#eef5ef;--muted:#a6b9ac;--line:#34483b;--green:#51bc8e;--green2:#309a6d;--danger:#ee8a8a;--shadow:none}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);line-height:1.55}a{color:var(--green);text-decoration:none}a:hover{text-decoration:underline}button,input,select{font:inherit}button,.button{display:inline-block;border:1px solid transparent;border-radius:9px;background:var(--green);color:var(--bg);padding:10px 16px;cursor:pointer;font-weight:650;text-align:center;text-decoration:none}button:hover,.button:hover{background:var(--green2);text-decoration:none}.secondary{border-color:var(--line);background:var(--surface);color:var(--text)}.secondary:hover{background:var(--surface2);color:var(--text)}:focus-visible{outline:3px solid var(--green);outline-offset:3px}input,select{width:100%;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:8px;padding:10px 12px;min-height:43px}label{display:flex;flex-direction:column;gap:6px;font-size:.87rem;font-weight:600}h1,h2,p{margin-top:0}h1{font-size:1.85rem;letter-spacing:-.04em;margin-bottom:0}h2{font-size:1.2rem;letter-spacing:-.02em;margin-bottom:14px}small{display:block;color:var(--muted);font-size:.8rem}.muted{color:var(--muted)}.eyebrow,.sidebar-caption{font-size:.69rem;font-weight:750;letter-spacing:.13em;color:var(--muted)}.brand{display:flex;gap:10px;align-items:center;color:var(--text);font-size:1.6rem;font-weight:800;letter-spacing:-.06em}.brand img{width:38px;height:38px}.brand small{font-size:.7rem;letter-spacing:0;color:var(--green)}.sidebar{position:fixed;inset:0 auto 0 0;width:248px;background:var(--surface);border-right:1px solid var(--line);padding:28px 22px;display:flex;flex-direction:column;z-index:2}.sidebar-caption{margin:36px 0 13px}.sidebar nav{display:flex;flex-direction:column;gap:5px}.sidebar nav a{padding:11px 12px;border-radius:8px;color:var(--muted);font-size:.9rem;font-weight:600;display:flex;justify-content:space-between;align-items:center}.sidebar nav a:hover,.sidebar nav a.active{background:var(--surface2);color:var(--green);text-decoration:none}.badge{background:var(--green);color:var(--bg);border-radius:20px;padding:1px 7px;font-size:.72rem}.sidebar-footer{margin-top:auto;padding-top:20px;border-top:1px solid var(--line)}.sidebar-footer button{margin-top:12px}.main{margin-left:248px;padding:34px 40px;max-width:1740px}.topbar{display:flex;justify-content:space-between;align-items:center;gap:24px;margin-bottom:30px}.top-controls{display:flex;align-items:flex-end;gap:12px}.top-controls form{display:flex;gap:6px}.top-controls label{font-size:.72rem}.top-controls select{max-width:205px;min-width:120px}.card,.stat{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:24px;margin-bottom:22px}.hero{background:var(--surface2);border:1px solid var(--line);border-radius:16px;padding:30px 32px;display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.hero h2{font-size:2rem;margin:10px 0}.hero-mark{font-size:5rem;padding:0 32px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.stat span{color:var(--muted);font-size:.85rem}.stat strong{display:block;font-size:2.3rem;font-weight:750;margin-top:6px;letter-spacing:-.05em}.card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}.card-grid .card{margin-bottom:0}.card-grid{margin-bottom:22px}.form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.form-end,.full{grid-column:1/-1}.form-end{padding-top:6px}.inline{display:inline-block;margin:3px 4px 3px 0}.inline button{padding:7px 11px;font-size:.8rem}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;text-align:left;font-size:.87rem}th{color:var(--muted);font-weight:600;font-size:.77rem;background:var(--surface2)}td,th{padding:14px 12px;border-bottom:1px solid var(--line);vertical-align:top}tr:last-child td{border-bottom:0}td a{white-space:nowrap;margin-right:8px}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:16px}.section-heading h2{margin:0}.section-heading input{max-width:260px}.task-row{display:flex;justify-content:space-between;align-items:center;gap:18px;border-top:1px solid var(--line);padding:16px 0}.task-row>div:first-child{flex:1}.pill{border-radius:20px;background:var(--surface2);color:var(--green);padding:5px 11px;font-size:.77rem;white-space:nowrap}.pill.danger{color:var(--danger);background:var(--surface2)}.notice{border:1px solid var(--line);border-left:4px solid var(--green);background:var(--surface);border-radius:9px;padding:14px 18px;margin-bottom:20px}.notice.error{border-left-color:var(--danger);color:var(--danger)}.mini-stats{display:flex;gap:18px;flex-wrap:wrap;margin:20px 0}.mini-stats span{font-size:.78rem;color:var(--muted)}.mini-stats strong{display:block;font-size:1.5rem;color:var(--text)}details{border-top:1px solid var(--line);padding:14px 0}summary{color:var(--green);cursor:pointer;font-weight:650}details .form{margin-top:18px}.filters{display:flex;flex-wrap:wrap;gap:8px}.filters a{padding:4px 9px;border-radius:6px;font-size:.8rem}.filters .selected{background:var(--surface2);font-weight:700}.empty{text-align:center;padding:50px}.lineage-level{display:flex;gap:22px;margin:16px 0;align-items:flex-start}.lineage-nodes{display:flex;flex-wrap:wrap;gap:12px}.lineage-node{background:var(--surface2);padding:12px;border:1px solid var(--line);border-radius:8px}footer{font-size:.75rem;color:var(--muted);padding:24px 0}.auth-main{max-width:1200px;margin:auto;padding:32px}.auth-card{max-width:480px;margin:60px auto;background:var(--surface);border:1px solid var(--line);padding:34px;border-radius:18px;box-shadow:var(--shadow)}.auth-card .brand{margin-bottom:30px}.auth-card .form{grid-template-columns:1fr}.auth-card .muted{font-size:.85rem;margin:20px 0 0}.installer{max-width:820px;margin:40px auto;padding:22px}.installer .brand{margin-bottom:24px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}[hidden]{display:none!important}
@media(max-width:1200px){.main{padding:26px 22px}.topbar{align-items:flex-start;flex-direction:column}.top-controls{flex-wrap:wrap}.stats{grid-template-columns:repeat(3,1fr)}.card-grid{grid-template-columns:1fr}}
@media(max-width:760px){.sidebar{position:static;width:auto;padding:16px}.sidebar .brand{font-size:1.4rem}.sidebar-caption{display:none}.sidebar nav{flex-direction:row;overflow:auto;margin-top:12px;gap:5px}.sidebar nav a{white-space:nowrap;padding:8px 11px}.sidebar-footer{display:none}.main{margin:0;padding:22px 16px}.form{grid-template-columns:1fr}.stats{grid-template-columns:repeat(2,1fr);gap:10px}.card,.stat{padding:18px}.hero{padding:22px}.hero-mark{display:none}.hero h2{font-size:1.65rem}.hero .button{margin-top:6px}.topbar{gap:16px;margin-bottom:22px}.top-controls{width:100%;gap:8px}.top-controls form{flex:1}.top-controls select{max-width:180px;min-width:100px}.section-heading{align-items:flex-start;flex-direction:column}.task-row{flex-wrap:wrap}.task-row>div:first-child{min-width:55%}.auth-main{padding:16px}.auth-main .topbar h1{font-size:1.4rem}.auth-card{margin:30px auto;padding:24px}.lineage-level{flex-direction:column;gap:8px}.mini-stats{gap:14px}h1{font-size:1.6rem}}

.checkline{display:flex;flex-direction:row;align-items:flex-start;gap:10px;font-weight:500}.checkline input{width:18px;min-height:18px;height:18px;flex-shrink:0;margin-top:3px}

.photo-preview{display:block;width:240px;max-width:100%;height:160px;object-fit:contain;border-radius:12px;margin-bottom:18px}.photo-thumb{float:left;width:52px;height:52px;object-fit:contain;border-radius:8px;margin-right:10px}

/* Plantel 1.2.1: miniaturas fixas e ações acessíveis no celular. */
#animal-table .animal-identity{display:flex;align-items:center;gap:10px;min-width:0}
#animal-table .animal-photo-link{display:block;flex:0 0 44px;width:44px;height:44px;margin:0}
#animal-table img.photo-thumb{display:block;float:none;width:44px!important;height:44px!important;min-width:44px;max-width:44px;max-height:44px;object-fit:contain;border-radius:8px;margin:0}
#animal-table .animal-name{white-space:normal;overflow-wrap:anywhere;margin:0}
#animal-table .animal-sheet-link{font-size:.78rem;display:inline-block;margin:3px 0 0}
#animal-table .animal-actions .button{min-height:44px;margin:2px 4px 2px 0}
.sheet-actions{display:flex;flex-wrap:wrap;gap:8px}.sheet-layout{display:flex;align-items:flex-start;gap:24px;margin:24px 0}
.sheet-photo{width:240px;height:180px;max-width:100%;object-fit:contain;border-radius:12px;flex-shrink:0}
.animal-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 24px;margin:0;flex:1;min-width:0}.animal-facts dt{color:var(--muted);font-size:.78rem}.animal-facts dd{margin:0;overflow-wrap:anywhere;font-weight:600}.animal-notes{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:760px){
 #animal-table,#animal-table tbody{display:block;width:100%}
 #animal-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
 #animal-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;border:1px solid var(--line);border-radius:12px;margin:0 0 14px;overflow:hidden}
 #animal-table td{display:block;padding:10px 12px;border:0;min-width:0;overflow-wrap:anywhere}
 #animal-table td::before{content:attr(data-label);display:block;font-size:.72rem;color:var(--muted);margin-bottom:4px}
 #animal-table td:first-child,#animal-table .animal-actions{grid-column:1/-1;background:var(--surface2)}
 #animal-table td:first-child::before{display:none}
 #animal-table .animal-actions{border-top:1px solid var(--line)}
 #animal-table .animal-actions .button{white-space:normal}
 .sheet-layout{flex-direction:column}.animal-facts{width:100%}.sheet-actions .button{min-height:44px}
}

.animal-editor{border-top:0;padding:0}.animal-editor[open]>summary{margin-bottom:14px}

.stat-link{display:block;color:var(--text);text-decoration:none}.stat-link:hover{color:var(--text);border-color:var(--green);background:var(--surface2);text-decoration:none}.stat-link small{color:var(--green);margin-top:10px}

.photo-preview,.photo-thumb,.sheet-photo{background:var(--surface2);object-position:center}

/* Navegação 1.2.6: uma única lista de links, com botão no celular. */
.sidebar-top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0}
.sidebar-content{display:flex;flex-direction:column;flex:1;min-height:0;overflow:auto}
.menu-toggle{display:none}
@media(max-width:760px){
 .sidebar{position:sticky;top:0;z-index:20;max-height:100dvh;padding:12px 16px;border-right:0;border-bottom:1px solid var(--line)}
 .sidebar .brand{font-size:1.35rem;white-space:nowrap}.sidebar .brand img{width:34px;height:34px}
 .menu-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:88px;min-height:44px;padding:8px 12px;flex-shrink:0}
 .sidebar-content{overflow:auto;max-height:calc(100dvh -78px)}
 .sidebar.menu-ready:not(.menu-open) .sidebar-content{display:none}
 .sidebar .sidebar-caption{display:block;margin:18px 12px 8px}
 .sidebar nav{display:flex;flex-direction:column;overflow:visible;margin-top:0;gap:4px}
 .sidebar nav a{white-space:normal;min-height:46px;padding:11px 12px;gap:10px;font-size:.95rem}
 .sidebar .sidebar-footer{display:block;flex-shrink:0;margin-top:18px;padding:16px 12px 4px}
 .sidebar-footer .inline button{min-height:44px;min-width:90px}
 .top-controls form{min-width:0}.top-controls form select{min-width:0;max-width:100%;flex:1}
}

.menu-theme{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:10px;color:var(--muted);font-size:.76rem;font-weight:500;margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid var(--line)}.menu-theme select{width:128px;max-width:65%;min-height:36px;padding:6px 8px;font-size:.8rem;border-color:var(--line);background:var(--surface);color:var(--muted)}
@media(max-width:760px){.menu-theme select{min-height:44px}}
