*{box-sizing:border-box}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;margin:0;background:#f5f3ef;color:#222}
header{background:#2b2118;color:white;padding:18px 24px}
header h1{margin:0;font-size:24px}
.container{max-width:1450px;margin:20px auto;padding:0 16px}
.toolbar{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px}
input,select,textarea,button,.btn{font:inherit;border:1px solid #c9c2b8;border-radius:8px;padding:9px 10px;background:white}
textarea{min-height:100px;width:100%}
.btn,button{cursor:pointer;text-decoration:none;color:#222}
.btn-primary{background:#4e3524;color:#fff;border-color:#4e3524}
.btn-danger{background:#8e2f2f;color:#fff;border-color:#8e2f2f}
.card{background:white;border:1px solid #ddd6cc;border-radius:12px;padding:16px;margin-bottom:18px}
.table-wrap{overflow:auto;background:white;border:1px solid #ddd6cc;border-radius:12px}
table{border-collapse:collapse;width:100%;min-width:1200px}
th,td{padding:10px;border-bottom:1px solid #eee6dc;text-align:left;vertical-align:top}
th{background:#eee8df;position:sticky;top:0}
.num{text-align:right;white-space:nowrap}
.muted{color:#746d65;font-size:13px}
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.field label{display:block;font-size:13px;font-weight:600;margin-bottom:5px}
.field input,.field select{width:100%}
.span2{grid-column:span 2}.span3{grid-column:span 3}
.badge{display:inline-block;padding:3px 7px;border-radius:999px;background:#eee8df}
@media(max-width:850px){.grid{grid-template-columns:1fr}.span2,.span3{grid-column:span 1}table{min-width:950px}}

.thumb{width:72px;height:72px;object-fit:cover;border-radius:10px;border:1px solid #ddd6cc;background:#faf8f4}
.hero{display:flex;gap:18px;align-items:flex-start}
.hero img{width:180px;max-height:240px;object-fit:cover;border-radius:12px;border:1px solid #ddd6cc}
.deg-card{border:1px solid #e5ddd2;border-radius:10px;padding:12px;margin:10px 0;background:#fff}
.deg-meta{display:flex;gap:12px;flex-wrap:wrap;font-size:14px;color:#625a52}
.preview{max-width:220px;max-height:220px;border-radius:10px;border:1px solid #ddd6cc;margin-top:8px}
@media(max-width:700px){.hero{flex-direction:column}.hero img{width:100%;max-width:320px}}

label.btn{min-height:44px;display:inline-flex;align-items:center;justify-content:center}

.inventory-summary{
display:flex;gap:28px;align-items:center;flex-wrap:wrap
}
.inventory-summary>div{display:flex;flex-direction:column}
.inventory-summary strong{font-size:22px}
.inventory-summary span{font-size:12px;color:#746d65;margin-top:2px}
.inventory-toolbar input[name=q]{min-width:240px;flex:1}

.cigar-grid{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(230px,1fr));
gap:18px;
align-items:stretch
}
.cigar-tile{
background:#fff;
border:1px solid #ddd6cc;
border-radius:14px;
overflow:hidden;
box-shadow:0 2px 10px rgba(0,0,0,.05);
display:flex;
flex-direction:column;
min-width:0
}
.tile-main{
display:block;
text-decoration:none;
color:inherit;
flex:1
}
.tile-photo{
height:210px;
position:relative;
background:#eee8df;
overflow:hidden
}
.tile-photo img{
width:100%;
height:100%;
object-fit:contain;
background:#faf8f4;
display:block
}
.photo-placeholder{
height:100%;
display:flex;
flex-direction:column;
align-items:center;
justify-content:center;
color:#7d746b;
background:linear-gradient(145deg,#f3eee7,#e8dfd4)
}
.photo-placeholder span{font-size:22px;font-weight:700}
.photo-placeholder small{margin-top:4px}
.stock-badge{
position:absolute;
right:9px;
bottom:9px;
background:rgba(43,33,24,.9);
color:#fff;
padding:5px 8px;
border-radius:999px;
font-size:12px;
font-weight:600
}
.tile-body{padding:14px}
.tile-origin{
font-size:12px;
text-transform:uppercase;
letter-spacing:.06em;
color:#746d65;
font-weight:700
}
.tile-body h2{
font-size:17px;
line-height:1.25;
margin:5px 0 10px
}
.tile-specs{
display:flex;
gap:6px;
flex-wrap:wrap;
margin-bottom:12px
}
.tile-specs span{
background:#f3eee7;
padding:4px 7px;
border-radius:999px;
font-size:11px
}
.tile-rating{
font-weight:700;
font-size:14px
}
.tile-rating small{
font-weight:400;
color:#746d65;
margin-left:5px
}
.tile-actions{
display:flex;
gap:7px;
padding:10px 12px 12px;
border-top:1px solid #eee6dc
}
.tile-actions .btn{
flex:1;
text-align:center;
font-size:13px;
padding:8px 7px
}
@media(max-width:600px){
.cigar-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.tile-photo{height:165px}
.tile-body{padding:10px}
.tile-body h2{font-size:14px}
.tile-actions{flex-direction:column}
.inventory-summary{gap:16px}
}

.brand-filter{
display:flex;
gap:8px;
overflow-x:auto;
padding:2px 0 14px;
margin-bottom:4px;
-webkit-overflow-scrolling:touch
}
.brand-chip{
white-space:nowrap;
text-decoration:none;
border:1px solid #c9c2b8;
background:#fff;
color:#2b2118;
border-radius:999px;
padding:7px 11px;
font-size:13px;
font-weight:600
}
.brand-chip.active{
background:#4e3524;
color:#fff;
border-color:#4e3524
}

.btn-compact{
padding:7px 9px;
font-size:12px;
min-height:auto;
white-space:nowrap
}
@media(max-width:700px){
.inventory-toolbar .btn-compact{
padding:6px 7px;
font-size:11px
}
}

/* V10 : recherche par mot-clé */
.inventory-toolbar input[name=q]{
    min-width:320px;
    flex:2;
}
@media(max-width:700px){
    .inventory-toolbar input[name=q]{
        min-width:100%;
        width:100%;
    }
}
