*{box-sizing:border-box;}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif;background:#f4f2ef;color:#2a2420;}
a{color:inherit;}
h1,h2{font-weight:600;margin:0;}
.muted{color:#8a7f74;font-size:.88rem;}

/* login */
.login-screen{min-height:100vh;display:flex;align-items:center;justify-content:center;background:#181513;}
.login-card{background:#fff;padding:40px;width:100%;max-width:360px;border-radius:6px;box-shadow:0 20px 50px rgba(0,0,0,.3);}
.login-card h1{font-size:1.4rem;margin-bottom:8px;}
.login-card p{margin-bottom:20px;}
.login-card label{display:block;font-size:.8rem;font-weight:600;margin-bottom:6px;}
.login-card input{width:100%;padding:10px 12px;border:1px solid #ddd6cd;border-radius:4px;font-size:.9rem;margin-bottom:14px;}

/* buttons */
.btn{display:inline-flex;align-items:center;gap:6px;padding:10px 18px;border-radius:4px;border:1px solid transparent;font-size:.84rem;font-weight:600;cursor:pointer;font-family:inherit;}
.btn-primary{background:#D08A6E;color:#fff;}
.btn-primary:hover{background:#c17a5d;}
.btn-ghost{background:#fff;border-color:#ddd6cd;color:#2a2420;}
.btn-ghost:hover{border-color:#D08A6E;color:#D08A6E;}
.btn-block{width:100%;justify-content:center;}
.btn-small{padding:7px 12px;font-size:.78rem;}
.btn-danger{background:#fff;border-color:#e2b8b8;color:#96303E;}
.btn-danger:hover{background:#96303E;color:#fff;}
.error-text{color:#96303E;font-size:.82rem;margin-top:6px;}
.saved-msg{color:#3a7d4f;font-size:.82rem;margin-left:12px;}

/* admin shell */
.admin-header{background:#fff;border-bottom:1px solid #e7e1d8;position:sticky;top:0;z-index:50;}
.admin-header-wrap{max-width:1100px;margin:0 auto;padding:18px 24px 0;display:flex;align-items:center;justify-content:space-between;}
.admin-header-actions{display:flex;gap:10px;}
.admin-tabs{max-width:1100px;margin:0 auto;padding:16px 24px 0;display:flex;gap:6px;}
.admin-tab{background:none;border:none;border-bottom:3px solid transparent;padding:10px 6px;margin-right:18px;font-size:.86rem;font-weight:600;color:#8a7f74;cursor:pointer;font-family:inherit;}
.admin-tab.active{color:#181513;border-color:#D08A6E;}
.admin-main{max-width:1100px;margin:0 auto;padding:28px 24px 60px;}
.admin-panel{}
.panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;}

/* products list */
.product-list{display:flex;flex-direction:column;gap:10px;}
.product-row{background:#fff;border:1px solid #e7e1d8;border-radius:6px;padding:14px 16px;display:flex;align-items:center;gap:14px;}
.product-row-thumb{width:52px;height:52px;border-radius:4px;background:#f0ece5;flex-shrink:0;overflow:hidden;display:flex;align-items:center;justify-content:center;}
.product-row-thumb img{width:100%;height:100%;object-fit:cover;}
.product-row-info{flex:1;min-width:0;}
.product-row-info b{display:block;font-size:.94rem;}
.product-row-info span{font-size:.78rem;color:#8a7f74;}
.product-row-swatches{display:flex;gap:4px;flex-shrink:0;}
.product-row-swatches span{width:14px;height:14px;border-radius:50%;display:inline-block;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);}
.product-row-price{font-family:'Courier New',monospace;font-size:.86rem;flex-shrink:0;width:130px;text-align:right;}
.product-row-actions{display:flex;gap:8px;flex-shrink:0;}
.product-row.unpublished{opacity:.55;}
.product-row-badge{font-size:.65rem;text-transform:uppercase;letter-spacing:.04em;background:#f0ece5;padding:3px 8px;border-radius:20px;color:#8a7f74;flex-shrink:0;}

/* settings form */
.settings-form,.theme-form{background:#fff;border:1px solid #e7e1d8;border-radius:8px;padding:24px;max-width:640px;}
.form-row{margin-bottom:16px;}
.form-row label{display:block;font-size:.8rem;font-weight:600;margin-bottom:6px;}
.form-row input[type=text],.form-row input[type=number],.form-row input[type=url],.form-row input[type=password],.form-row textarea{
  width:100%;padding:9px 12px;border:1px solid #ddd6cd;border-radius:4px;font-size:.88rem;font-family:inherit;
}
.form-row textarea{resize:vertical;}
.field-hint{font-size:.72rem;color:#a89d90;margin-top:4px;}
.field-hint-inline{font-weight:400;color:#a89d90;}
.form-row-inline{display:flex;gap:16px;}
.form-row-inline > div{flex:1;}
.form-row-checkboxes{display:flex;flex-direction:column;gap:8px;}
.checkbox-label{display:flex;align-items:center;gap:8px;font-size:.85rem;font-weight:400;}

/* theme tab */
.theme-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px;margin-bottom:20px;}
.theme-field{display:flex;align-items:center;gap:10px;border:1px solid #e7e1d8;border-radius:6px;padding:10px 12px;}
.theme-field label{font-size:.78rem;font-weight:600;flex:1;}
.theme-field input[type=color]{width:36px;height:36px;border:none;border-radius:4px;padding:0;cursor:pointer;background:none;}
.theme-preview{margin-top:24px;}
.theme-preview-card{background:var(--tp-bg,#181513);color:var(--tp-ivory,#F3EADF);padding:24px;border-radius:8px;max-width:340px;}
.tp-eyebrow{color:var(--tp-accent-bright,#E4A184);font-size:.68rem;text-transform:uppercase;letter-spacing:.15em;margin-bottom:8px;}
.tp-heading{font-size:1.2rem;font-weight:600;margin-bottom:16px;}
.tp-card{background:var(--tp-surface,#221d19);border:1px solid var(--tp-line,rgba(255,255,255,.1));border-radius:4px;overflow:hidden;}
.tp-card-media{aspect-ratio:4/3;background:var(--tp-surface2,#2a2420);}
.tp-card-body{padding:12px;}
.tp-card-name{font-weight:600;font-size:.9rem;margin-bottom:6px;}
.tp-card-price{font-family:monospace;margin-bottom:10px;}
.tp-btn{background:var(--tp-accent,#D08A6E);color:var(--tp-bg,#181513);border:none;padding:8px 14px;border-radius:2px;font-size:.75rem;font-weight:600;text-transform:uppercase;cursor:default;}

/* modal */
.modal-backdrop{position:fixed;inset:0;background:rgba(20,16,14,.55);display:none;align-items:flex-start;justify-content:center;z-index:200;padding:40px 20px;overflow-y:auto;}
.modal-backdrop.open{display:flex;}
.modal-box{background:#fff;border-radius:8px;max-width:640px;width:100%;padding:32px;position:relative;}
.modal-close{position:absolute;top:14px;right:16px;background:none;border:none;font-size:1.6rem;cursor:pointer;color:#8a7f74;line-height:1;}
.modal-close:hover{color:#D08A6E;}
.modal-box h2{margin-bottom:20px;font-size:1.2rem;}
.form-actions{display:flex;align-items:center;gap:12px;margin-top:8px;}

/* colour rows in product form */
.color-rows{display:flex;flex-direction:column;gap:10px;margin-bottom:12px;}
.color-row{display:flex;align-items:center;gap:10px;border:1px solid #e7e1d8;border-radius:6px;padding:10px;}
.color-row input[type=text]{flex:1;padding:8px 10px;border:1px solid #ddd6cd;border-radius:4px;font-size:.84rem;}
.color-row input[type=color]{width:34px;height:34px;border:none;padding:0;border-radius:4px;cursor:pointer;}
.color-thumb{width:40px;height:40px;border-radius:4px;background:#f0ece5;flex-shrink:0;overflow:hidden;display:flex;align-items:center;justify-content:center;font-size:.6rem;color:#a89d90;text-align:center;}
.color-thumb img{width:100%;height:100%;object-fit:cover;}
.color-row-remove{background:none;border:none;color:#a89d90;cursor:pointer;font-size:1.1rem;padding:4px;flex-shrink:0;}
.color-row-remove:hover{color:#96303E;}

@media (max-width:600px){
  .admin-header-wrap{flex-direction:column;align-items:flex-start;gap:10px;}
  .form-row-inline{flex-direction:column;}
  .product-row{flex-wrap:wrap;}
  .product-row-price{width:auto;text-align:left;}
}
