@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');
:root,:root[data-theme="light"]{font-family:'DM Sans',sans-serif;--page-bg:#f7f5ec;--panel-bg:#fffdf7;--raised-bg:#edf0e4;--text:#173e31;--muted:#6c786e;--line:#dce1d7;--soft:#e9eee4;--green:#123f31;--navy:#173e31;--button-text:#fffdf7;--danger:#a34d40;--danger-soft:#f6e7e2}
:root[data-theme="dark"]{--page-bg:#1c2520;--panel-bg:#28352c;--raised-bg:#344439;--text:#e5eee5;--muted:#adbcae;--line:#60735f;--soft:#344439;--green:#b4cbaa;--navy:#e5eee5;--button-text:#344c3c;--danger:#e39b8e;--danger-soft:#4a302d}
.card{background:var(--panel-bg)!important;color:var(--text)!important;border-color:var(--line)!important;box-shadow:0 12px 38px #102b2318!important}body{font-family:'DM Sans',sans-serif!important;background:var(--page-bg)!important;color:var(--text)!important}
h1,h2,h3,.brand,.stat strong{font-family:Manrope,sans-serif;letter-spacing:-.035em}
h1{font-weight:600}h2{font-weight:600}.brand span{font-weight:800}
header,nav,.panel,.stat,table{background:var(--panel-bg)!important;color:var(--text)!important}
header{box-shadow:0 4px 24px #102b2308}nav{padding-top:20px}nav a{font-size:.93rem;gap:12px;border-radius:10px}nav a:hover,nav a[aria-current=page]{background:var(--soft);color:var(--green)}nav a[aria-current=page]{font-weight:700;box-shadow:inset 3px 0 #b78e29}
.panel,.stat{border-radius:16px;box-shadow:0 8px 28px #102b2308;border-color:var(--line)}.stat{min-height:125px}.stat-icon{width:46px;height:46px;padding:9px;background:var(--soft);border-radius:12px}.stat strong{font-weight:600}.heading-icon{color:var(--green)}
button,.btn{border-radius:8px;font-weight:400}.logout-button,.theme-toggle,.mobile-menu-toggle{background:var(--soft)!important;color:var(--navy)!important}
input,select,textarea{background:var(--panel-bg)!important;border-color:var(--line)!important;color:var(--text)!important;border-radius:9px}input:focus,select:focus,textarea:focus{outline:2px solid #b78e29;outline-offset:2px}
th{background:var(--soft);font-size:.78rem;font-weight:700}th,td{border-color:var(--line)!important}tbody tr:hover{background:var(--soft)}.muted,.stat-label{color:var(--muted)!important}
.calendar-event{background:var(--soft)!important;color:var(--navy)!important}.calendar-day.today .day-number{background:#f3cc64;color:#233a23}.calendar-weekday{background:var(--soft)!important;color:var(--navy)!important}

@media(prefers-color-scheme:dark){:root:not([data-theme="light"]){--page-bg:#1c2520;--panel-bg:#28352c;--raised-bg:#344439;--text:#e5eee5;--muted:#adbcae;--line:#60735f;--soft:#344439;--green:#b4cbaa;--navy:#e5eee5;--button-text:#344c3c;--danger:#e39b8e;--danger-soft:#4a302d}}

:root{color-scheme:light}:root[data-theme="dark"]{color-scheme:dark}@media(prefers-color-scheme:dark){:root:not([data-theme="light"]){color-scheme:dark}}

@media(max-width:700px){nav{padding-top:8px}.stat{min-height:92px}}

/* Conserver les boutons d'origine sans hériter du fond miel des formulaires. */
button.dashboard-task-complete[type=submit]{background:transparent!important;color:var(--green)!important;border-radius:50%;font-weight:inherit}
button.dashboard-task-complete[type=submit]:hover,button.dashboard-task-complete[type=submit]:active{background:var(--soft)!important}
.dashboard-task-complete:focus-visible svg{opacity:1}

/* Cadres sans bordures ; conserver les contours des contrôles. */
.panel,.stat,.card,.dashboard-planning-group,.task-card,.workflow-empty,.quick-add-dialog{border:0!important}

.dashboard-stats{margin-bottom:16px}.dashboard-stats>.stat{margin-bottom:0}

header,nav#primary-nav{border:0!important}

nav#primary-nav{scrollbar-width:none}nav#primary-nav::-webkit-scrollbar{display:none}

.brand .brand-pilot{color:#f3cc64}
:root[data-theme="dark"] .brand .brand-pilot{color:#f3cc64}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]) .brand .brand-pilot{color:#f3cc64}}

/* Illustrations SVG : bois, miel, feuillage et papier, adaptés au thème. */
:root{--icon-wood:#d7aa71;--icon-honey:#f3cc64;--icon-green:#71804e;--icon-paper:#fffdf7;--icon-blue:#b5c9c5;--icon-outline:#344c3c;--icon-danger:#c57562}
:root[data-theme="dark"]{--icon-wood:#d8b586;--icon-honey:#f3cc64;--icon-green:#a5bc83;--icon-paper:#e4eadd;--icon-blue:#aac5c1;--icon-outline:#283d30;--icon-danger:#e49b86}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]){--icon-wood:#d8b586;--icon-honey:#f3cc64;--icon-green:#a5bc83;--icon-paper:#e4eadd;--icon-blue:#aac5c1;--icon-outline:#283d30;--icon-danger:#e49b86}}
svg.illustrated-icon{fill:none;stroke:var(--icon-outline);stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;vertical-align:middle}

svg.illustrated-icon{stroke:#6c481f;stroke-width:1.2;filter:drop-shadow(0 1px 1px #0002)}

.icon-heading{display:flex;align-items:center;gap:10px}
.icon-heading>.title-illustration{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;line-height:1}
h1.icon-heading>.title-illustration{width:40px;height:40px}
h2.icon-heading>.title-illustration{width:28px;height:28px}
h3.icon-heading>.title-illustration{width:24px;height:24px}

/* Illustrations peintes sur fond transparent. */
img.illustrated-icon-raster{display:inline-block;object-fit:contain;flex-shrink:0;vertical-align:middle}
nav img.illustrated-icon-raster{width:32px;height:32px}
.stat-icon img.illustrated-icon-raster{width:48px;height:48px}

.theme-toggle img.illustrated-icon-raster{display:none;width:24px;height:24px}

/* Pr?sentation valid?e du tableau de bord et du menu global. */
:root,:root[data-theme="light"]{--page-bg:#f3f6fa;--panel-bg:#e5ebf3;--raised-bg:#f7f9fc;--text:#25364b;--muted:#63758b;--line:transparent;--soft:#dce5f0;--green:#365c85;--navy:#25364b;--button-text:#f7f9fc}
:root[data-theme="dark"]{--page-bg:#19232f;--panel-bg:#273648;--raised-bg:#202d3d;--text:#edf1f7;--muted:#bcc9da;--line:transparent;--soft:#3b526e;--green:#c0d2eb;--navy:#edf1f7;--button-text:#202d3d}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]){--page-bg:#19232f;--panel-bg:#273648;--raised-bg:#202d3d;--text:#edf1f7;--muted:#bcc9da;--line:transparent;--soft:#3b526e;--green:#c0d2eb;--navy:#edf1f7;--button-text:#202d3d}}

header{display:block;height:auto;min-height:78px;padding:0;background:var(--soft)!important}
.header-inner{display:grid;grid-template-columns:150px minmax(0,1fr) auto;align-items:center;gap:12px;max-width:1180px;margin:auto;padding:16px 24px;position:relative}
main{max-width:1180px;margin:0 auto;padding:28px 24px}
.header-inner .brand img{width:42px;height:42px}.header-inner .brand span{font-size:19px}
header nav#primary-nav{position:static;inset:auto;display:flex;flex-direction:row;flex-wrap:wrap;align-items:start;justify-content:center;width:auto;max-height:none;padding:0;gap:4px;overflow:visible;background:transparent!important}
header nav#primary-nav a{display:flex;flex-direction:column;gap:5px;min-width:48px;min-height:72px;padding:5px 4px;font-size:10px;line-height:1.2;text-align:center}
header nav#primary-nav img.nav-icon{width:44px;height:44px;flex:0 0 44px}
header nav#primary-nav a[aria-current=page]{box-shadow:none}.header-tools{margin:0;gap:8px;flex-wrap:wrap;justify-content:flex-end;max-width:140px}.header-tools small{font-size:12px}.logout-button{font-size:11px}
.panel,.stat,.card{box-shadow:none!important;border:0!important;border-radius:16px}.stat-icon{width:64px;height:64px;flex:0 0 64px;padding:0;background:transparent}.stat-icon img.illustrated-icon-raster{width:64px;height:64px}.stat{min-height:110px;gap:16px;padding:22px;position:relative}.stat strong{font-size:29px}.stat-label{font-size:14px;margin-top:5px}.stat-add{margin-left:auto}
.dashboard-stats{gap:16px;margin-bottom:24px}.dashboard-overview{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);gap:20px;margin-bottom:24px;align-items:start}.dashboard-overview>.panel{margin:0;padding:24px}.dashboard-harvest{display:flex;align-items:center;gap:18px;margin:24px 0}.dashboard-harvest strong{font-size:30px}.dashboard-apiary p{line-height:1.6;overflow-wrap:anywhere}.dashboard-planning-grid{display:grid;grid-template-columns:1fr;gap:16px}.dashboard-planning-group{padding:0;background:transparent}.dashboard-planning-task{border:0;padding:14px 0}.dashboard-planning-task p{margin:5px 0;color:var(--muted)}.dashboard-task-heading h4{margin:0}.panel-head{flex-wrap:wrap}
input,select,textarea{background:var(--raised-bg)!important;border:0!important}.workflow-tabs a,.workflow-badge,.workflow-checks label,.workflow-report,.workflow-sticky,th,td{border:0!important}
h1.icon-heading{font-size:28px}h1.icon-heading>.title-illustration{width:44px;height:44px}h1.icon-heading img.illustrated-icon-raster{width:44px;height:44px}
footer{max-width:1180px;margin:0 auto;padding:18px 24px}
@media(max-width:1000px){.dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-overview{grid-template-columns:1fr}.header-inner{grid-template-columns:140px minmax(0,1fr) auto}}
@media(max-width:700px){.header-inner{grid-template-columns:1fr 44px;padding:14px 24px}.mobile-menu-toggle{grid-column:2;grid-row:1}.header-tools{grid-column:1/-1;grid-row:2;max-width:none}header nav#primary-nav{display:none;grid-column:1/-1;grid-row:3}header nav#primary-nav.is-open{display:flex}main{margin:0 auto;padding:24px}.stat{padding:14px;gap:8px}.stat-icon,.stat-icon img.illustrated-icon-raster{width:48px;height:48px}.stat-icon{flex-basis:48px}.stat strong{font-size:24px}}
@media(max-width:480px){main,.header-inner{padding:14px}.dashboard-stats{grid-template-columns:1fr}.dashboard-overview>.panel{padding:18px}}

/* Menu principal sur une ligne, compte utilisateur et alignement partag?. */
.header-inner{grid-template-columns:140px minmax(0,1fr) auto;gap:10px}
header nav#primary-nav{flex-wrap:nowrap;gap:2px;min-width:0}
header nav#primary-nav a{min-width:0;flex:1 1 0;padding:5px 2px;white-space:nowrap;font-size:9px}
header nav#primary-nav img.nav-icon{width:40px;height:40px;flex-basis:40px}
.header-tools{max-width:none;flex-wrap:nowrap;gap:6px}
.logout-button{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;padding:4px!important;margin:0!important}
.user-menu{position:relative;min-width:0}.user-menu summary{display:flex;align-items:center;gap:6px;cursor:pointer;list-style:none;font-size:13px;padding:8px 4px}.user-menu summary::-webkit-details-marker{display:none}.user-menu summary>span:first-child{max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-chevron{font-size:18px;line-height:1}.user-menu-items{position:absolute;right:0;top:100%;min-width:190px;padding:8px;background:var(--panel-bg);border-radius:12px;box-shadow:0 8px 24px #0003;z-index:30}.user-menu-items a{display:flex;align-items:center;gap:10px;padding:10px;border-radius:8px;color:var(--text);text-decoration:none;font-size:14px}.user-menu-items a:hover{background:var(--soft)}
@media(min-width:701px) and (max-width:1050px){.header-inner{grid-template-columns:110px minmax(0,1fr) auto;gap:6px}.header-inner .brand span{font-size:16px}.header-inner .brand img{width:30px;height:30px}.header-inner .brand{gap:4px}header nav#primary-nav a{font-size:8px}header nav#primary-nav img.nav-icon{width:30px;height:30px;flex-basis:30px}.user-menu summary>span:first-child{max-width:55px}}
@media(max-width:700px){.header-inner{grid-template-columns:1fr 44px}header nav#primary-nav{overflow-x:auto;justify-content:flex-start}header nav#primary-nav a{flex:0 0 62px;font-size:10px}.header-tools{grid-column:1/-1;grid-row:2;justify-content:flex-end}.user-menu summary>span:first-child{max-width:160px}}

/* Surbrillance sur les illustrations, sans modifier les libelles. */
header nav#primary-nav a:hover,header nav#primary-nav a[aria-current=page]{background:transparent;color:var(--navy);box-shadow:none;font-weight:400}
header nav#primary-nav img.nav-icon,.logout-button img.illustrated-icon-raster{border-radius:10px;transition:background-color .15s,box-shadow .15s}
header nav#primary-nav a:hover img.nav-icon,header nav#primary-nav a[aria-current=page] img.nav-icon,header nav#primary-nav a:focus-visible img.nav-icon{background:var(--soft);box-shadow:0 0 0 4px var(--soft)}
.logout-button,.logout-button:hover,.logout-button[type=submit]{background:transparent!important;box-shadow:none!important}
.logout-button:hover img.illustrated-icon-raster,.logout-button:focus-visible img.illustrated-icon-raster{background:var(--soft);box-shadow:0 0 0 4px var(--soft)}

/* Header compact et contraste distinct pour les icones interactives. */
:root,:root[data-theme="light"]{--menu-highlight:#c6d7eb;--menu-highlight-ring:#7d9bbf}
:root[data-theme="dark"]{--menu-highlight:#465e7d;--menu-highlight-ring:#b6c9e2}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]){--menu-highlight:#465e7d;--menu-highlight-ring:#b6c9e2}}
header{min-height:64px}.header-inner{padding-top:8px;padding-bottom:8px}
header nav#primary-nav a{min-height:60px;padding-top:2px;padding-bottom:2px;gap:3px}
header nav#primary-nav a:hover img.nav-icon,header nav#primary-nav a[aria-current=page] img.nav-icon,header nav#primary-nav a:focus-visible img.nav-icon,.logout-button:hover img.illustrated-icon-raster,.logout-button:focus-visible img.illustrated-icon-raster{background:var(--menu-highlight);box-shadow:none}
@media(max-width:700px){.header-inner{padding-top:8px;padding-bottom:8px}}

/* Compte utilisateur en accord avec les surfaces et les accents du theme. */
.user-menu summary{background:var(--panel-bg);color:var(--text);border-radius:10px;padding:9px 10px;gap:8px;font-weight:600;font-size:12px;transition:background-color .15s}
.user-menu summary:hover,.user-menu[open] summary{background:var(--menu-highlight);color:var(--text)}
.user-menu summary:focus-visible{outline:2px solid var(--green);outline-offset:3px}
.user-chevron{color:var(--green);font-size:16px;transition:transform .15s}
.user-menu[open] .user-chevron{transform:rotate(180deg)}
.user-menu-items{margin-top:8px;background:var(--panel-bg);padding:8px;border:0;border-radius:12px}
.user-menu-items a{font-weight:500}.user-menu-items a:hover{background:var(--soft);color:var(--text)}

/* Chevron fin dessine en CSS, centre sur la ligne du nom. */
.user-chevron{display:inline-block;width:7px;height:7px;flex:0 0 7px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:translateY(-2px) rotate(45deg);margin-left:2px;transition:transform .15s}
.user-menu[open] .user-chevron{transform:translateY(2px) rotate(225deg)}

.logout-button{width:48px;height:48px}
.logout-button img.illustrated-icon-raster{width:40px;height:40px}
@media(min-width:701px) and (max-width:1050px){.logout-button{width:38px;height:38px}.logout-button img.illustrated-icon-raster{width:30px;height:30px}}

@media(max-width:700px){
.header-inner,main{width:100%;min-width:0}.header-tools{min-width:0}.user-menu summary{min-height:44px}.user-menu summary>span:first-child{max-width:min(160px,35vw)}.user-menu-items{max-width:calc(100vw - 28px)}
.dashboard-planning-grid{grid-template-columns:1fr!important}.dashboard-overview>.panel{min-width:0}.dashboard-task-heading h4{overflow-wrap:anywhere}.dashboard-planning-task p{overflow-wrap:anywhere}.panel-head .btn{white-space:normal}
.fields{grid-template-columns:1fr!important}.fields>label{min-width:0}input,select,textarea{max-width:100%;font-size:16px}
.stat-add{min-width:44px;min-height:44px}.dashboard-harvest{gap:12px}.dashboard-harvest img{width:80px;height:80px}.dashboard-harvest strong{font-size:26px}
}

/* Palette et boutons identiques a la proposition validee. */
:root,:root[data-theme="light"]{--header-bg:#dce5f0;--muted:#65778f;--action-bg:#ccdbed;--action-text:#294969;--action-hover:#bacfe7;--tag-bg:#fcf1d9;--tag-text:#896527}
:root[data-theme="dark"]{--header-bg:#202d3d;--action-bg:#3b526e;--action-text:#eef3fa;--action-hover:#4b6586;--tag-bg:#594b29;--tag-text:#f6dfa1}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]){--header-bg:#202d3d;--muted:#bcc9da;--action-bg:#3b526e;--action-text:#eef3fa;--action-hover:#4b6586;--tag-bg:#594b29;--tag-text:#f6dfa1}}
header{background:var(--header-bg)!important}
button,.btn,.collapsible-form>button,.creation-panel .btn{background:var(--action-bg);color:var(--action-text);border:0;border-radius:8px;padding:10px 14px;font-weight:400;text-decoration:none;transition:background-color .15s}
button:hover,.btn:hover{background:var(--action-hover);color:var(--action-text)}
button:disabled,.btn[aria-disabled=true]{opacity:.55;cursor:default}
button:focus-visible,.btn:focus-visible{outline:3px solid #ba8a38;outline-offset:3px}
.workflow-badge{background:var(--tag-bg);color:var(--tag-text)}
/* Les commandes illustrees gardent leurs dimensions et leur surbrillance. */
.theme-toggle,.mobile-menu-toggle{padding:8px}.stat-add{padding:4px}.dialog-close{padding:4px 8px}.user-menu summary{background:var(--panel-bg)}

/* Planning du tableau de bord : liste compacte inspirée de la proposition. */
.dashboard-planning-row{display:flex;align-items:center;gap:12px;padding:17px 0}
.dashboard-planning-row>form{margin:0;flex-shrink:0}
.dashboard-planning-details{flex:1;min-width:0}
.dashboard-planning-details h3{margin:0;font-size:1rem;overflow-wrap:anywhere}
.dashboard-planning-details p{margin:5px 0 0;font-size:.9rem;overflow-wrap:anywhere}
.dashboard-planning-row>.workflow-badge{margin-left:auto;flex-shrink:0}
.dashboard-planning-row .dashboard-task-complete::before{inset:4px;border-radius:3px}
@media(max-width:480px){.dashboard-planning-row{flex-wrap:wrap}.dashboard-planning-row>.workflow-badge{margin-left:38px}.dashboard-planning-details{flex-basis:calc(100% - 38px)}}

.dashboard-planning-row>.workflow-badge{background:#fcf1d9;color:#896527;padding:5px 10px;font-size:12px}
:root[data-theme="dark"] .dashboard-planning-row>.workflow-badge{background:#594b29;color:#f6dfa1}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]) .dashboard-planning-row>.workflow-badge{background:#594b29;color:#f6dfa1}}

/* En-tête smartphone : hamburger, titre et compte sur une seule ligne. */
@media(max-width:700px){
.header-inner{grid-template-columns:40px minmax(0,1fr) auto;gap:6px;padding:8px 10px}
.header-inner .mobile-menu-toggle{grid-column:1;grid-row:1;width:40px;height:44px;margin:0}
.header-inner .brand{grid-column:2;grid-row:1;min-width:0;gap:0}
.header-inner .brand>img{display:none}
.header-inner .brand span{font-size:16px}
.header-inner .header-tools{grid-column:3;grid-row:1;gap:4px;flex-wrap:nowrap;justify-content:flex-end}
.header-tools .theme-toggle,.header-tools .logout-button{width:36px;height:44px;margin:0;flex-shrink:0}
.header-tools .logout-button img.illustrated-icon-raster{width:30px;height:30px}
.header-tools .user-menu{min-width:0}
.header-tools .user-menu summary{padding:9px 6px;gap:5px}
.header-tools .user-menu summary>span:first-child{max-width:clamp(36px,calc(100vw - 290px),120px)}
.header-tools>form{margin:0;flex-shrink:0}
header nav#primary-nav{grid-column:1/-1;grid-row:2}
}
@media(max-width:360px){.header-inner{gap:4px;padding-inline:8px}.header-inner .brand span{font-size:14px}.header-inner .header-tools{gap:2px}}

.btn-with-add-icon{display:inline-flex;align-items:center;justify-content:center;gap:8px}
.btn-with-add-icon>span{display:inline-flex;flex-shrink:0}
.production-bulk-lots>.form-toggle{margin-bottom:16px}

/* Alternating data rows, using the active light or dark theme. */
main table>tbody>tr:nth-child(odd)>td,main table>tbody>tr:nth-child(odd)>th[scope="row"]{background:var(--panel-bg)}
main table>tbody>tr:nth-child(even)>td,main table>tbody>tr:nth-child(even)>th[scope="row"]{background:var(--soft)}
main table>tbody>tr:hover>td,main table>tbody>tr:hover>th[scope="row"]{background:var(--raised-bg)}

:root,:root[data-theme="light"]{--hive-card-bg:#e2efff;--hive-card-image-bg:#d3e5fb;--hive-card-text:#254360;--hive-card-border:#b9d2ee}
:root[data-theme="dark"]{--hive-card-bg:#29415b;--hive-card-image-bg:#21374e;--hive-card-text:#edf5ff;--hive-card-border:#536e8b}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]):not([data-theme="dark"]){--hive-card-bg:#29415b;--hive-card-image-bg:#21374e;--hive-card-text:#edf5ff;--hive-card-border:#536e8b}}

.cash-date-filter{align-items:flex-end;gap:8px}
.cash-date-filter>label{display:flex;flex-direction:column;gap:6px;margin:0;min-width:0}
.cash-date-filter input,.cash-date-filter>button{height:40px;margin:0}

.hive-reference{display:inline-flex;align-items:center;gap:6px;vertical-align:middle;max-width:100%}
.hive-reference>.illustrated-icon{width:20px;height:20px;flex:0 0 20px;object-fit:contain}
.hive-reference>span{min-width:0;overflow-wrap:anywhere}
select[name="hive_id"],select[name="breeder_hive_id"],select[name="target"]:has(option:checked[value^="hive:"]){background-image:url('/static/illustrated-icons/hives.webp')!important;background-repeat:no-repeat!important;background-size:20px 20px!important;background-position:10px center!important;padding-left:36px}

/* Keep account controls aligned when a label wraps onto two lines. */
.account-creation-form{margin-bottom:24px}
.account-creation-form .fields{align-items:end}
.account-creation-form .fields>label:not([hidden]){display:flex;flex-direction:column;gap:6px;margin:0}
.account-creation-form input,.account-creation-form select{box-sizing:border-box;height:42px;margin:0}
