
:root{--bg:#f6f2ec;--panel:#fff;--text:#191919;--muted:#6b7280;--primary:#b86d34;--border:#e6d7c4;--danger:#b91c1c;--success:#166534}
*{box-sizing:border-box}body{margin:0;font-family:Inter,Arial,sans-serif;background:var(--bg);color:var(--text)}a{text-decoration:none;color:inherit}
.admin-shell{display:grid;grid-template-columns:280px 1fr;min-height:100vh}
.admin-sidebar{background:#111827;color:#fff;padding:24px;position:sticky;top:0;height:100vh;overflow:auto}
.admin-brand{display:flex;gap:12px;align-items:center;margin-bottom:24px}
.admin-brand small{display:block;color:#cbd5e1}
.admin-nav{display:grid;gap:8px}
.admin-nav a{padding:12px 14px;border-radius:14px;color:#e5e7eb}
.admin-nav a.active,.admin-nav a:hover{background:#1f2937}
.admin-main{padding:28px}
.admin-topbar{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:18px}
.admin-topbar p{color:var(--muted);margin:6px 0 0}
.admin-user-chip{background:#fff;border:1px solid var(--border);padding:12px 16px;border-radius:999px}
.admin-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:14px;margin-bottom:18px}
.stat-card,.admin-panel,.login-card{background:var(--panel);border:1px solid var(--border);border-radius:22px}
.stat-card{padding:20px}.stat-card strong{font-size:28px;display:block}
.admin-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px}
.admin-panel{padding:18px}
.panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.panel-head h2,.panel-head h3{margin:0}
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse}
th,td{padding:12px;border-bottom:1px solid var(--border);text-align:left;vertical-align:top}
.stack-form{display:grid;gap:12px}
.stack-form input,.stack-form textarea,.stack-form select{width:100%;padding:12px 14px;border:1px solid var(--border);border-radius:14px;font:inherit;background:#fff}
.form-grid-admin{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.form-grid-admin .full{grid-column:1/-1}
.primary-btn,.secondary-btn,.danger-outline{display:inline-flex;align-items:center;justify-content:center;padding:12px 16px;border-radius:999px;border:0;font-weight:700;cursor:pointer}
.primary-btn{background:var(--primary);color:#fff}
.secondary-btn{background:#f5eadf;color:var(--text)}
.danger-outline{background:#fff;border:1px solid #fecaca;color:var(--danger)}
.small{padding:9px 12px;font-size:13px}
.badge{display:inline-flex;padding:6px 10px;background:#f1f5f9;border-radius:999px;font-size:12px;font-weight:700}
.badge.ok{background:#dcfce7;color:var(--success)}
.badge.off{background:#fee2e2;color:#991b1b}
.admin-alert{padding:14px 16px;border-radius:16px;margin-bottom:16px}
.admin-alert.success{background:#ecfdf5;color:#166534;border:1px solid #bbf7d0}
.admin-alert.error{background:#fff5f5;color:#991b1b;border:1px solid #fecaca}
.checkbox-line,.checkbox-cluster label{display:flex;align-items:center;gap:10px}
.checkbox-cluster{display:flex;flex-wrap:wrap;gap:16px}
.actions-cell{display:flex;gap:8px;flex-wrap:wrap}
.button-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.color-row,.theme-input-row{display:grid;grid-template-columns:1fr 110px auto;gap:10px;align-items:center}
.color-row input[type="color"],.theme-input-row input[type="color"]{padding:0;height:44px}
.code-box{padding:14px;border-radius:16px;background:#0f172a;color:#e2e8f0;overflow:auto;max-height:420px}
.theme-preview-box{border:1px solid var(--border);border-radius:24px;overflow:hidden;background:var(--theme-bg,#fff8f2)}
.theme-preview-header,.theme-preview-footer{padding:14px 18px;background:var(--theme-header-bg,#fff)}
.theme-preview-card{margin:18px;padding:18px;border-radius:18px;background:var(--theme-card-bg,#fff);border:1px solid var(--theme-border,#ddd);color:var(--theme-text,#111)}
.theme-preview-card .eyebrow{color:var(--theme-primary-dark,#7c2d12)}
.btn-preview-primary,.btn-preview-secondary{padding:12px 18px;border-radius:999px;border:0}
.btn-preview-primary{background:var(--theme-primary,#b86d34);color:#fff}
.btn-preview-secondary{background:var(--theme-secondary,#f3e7d9);color:var(--theme-text,#111)}
.theme-preview-footer{background:var(--theme-footer-bg,#111);color:var(--theme-footer-text,#fff)}
.addon-admin-group{padding-top:14px;border-top:1px solid var(--border);margin-top:14px}
.admin-login-body{display:grid;place-items:center;min-height:100vh;padding:20px}
.login-card{width:min(420px,100%);padding:24px}
@media (max-width: 1100px){.admin-cards{grid-template-columns:repeat(3,minmax(0,1fr))}.admin-grid-2,.button-grid,.form-grid-admin{grid-template-columns:1fr}}
@media (max-width: 860px){.admin-shell{grid-template-columns:1fr}.admin-sidebar{position:static;height:auto}.admin-topbar{flex-direction:column}.admin-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}

.admin-grid-wide{grid-template-columns:minmax(0,1fr) minmax(0,1.1fr)}
.theme-preview-frame,.email-preview-frame{width:100%;min-height:540px;border:1px solid var(--theme-border,#ddd);border-radius:18px;background:#fff}
.theme-live-legend{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin-top:14px}.theme-live-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid #e5e7eb;border-radius:14px;background:#fff}.theme-live-item .swatch{display:inline-block;width:20px;height:20px;border-radius:999px;border:1px solid #d1d5db}
.tabs-row{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px}.email-tab-btn.is-active{background:#111827;color:#fff;border-color:#111827}.widget-host-block{display:grid;gap:12px}.provider-frame{width:100%;min-height:380px;border:1px solid var(--theme-border,#ddd);border-radius:18px;background:#fff}.muted{color:#6b7280}


.theme-preview-toolbar{display:flex;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:14px}
.theme-preview-tab.is-active,.theme-device-btn.is-active{background:#111827;color:#fff}
.theme-preview-shell{display:flex;justify-content:center;align-items:flex-start;padding:14px;border:1px solid var(--border);border-radius:22px;background:#f7f3ee;min-height:82vh;overflow:auto}
.theme-preview-shell.is-desktop .theme-preview-frame{width:100%;max-width:1440px;height:80vh}
.theme-preview-shell.is-tablet .theme-preview-frame{width:820px;max-width:100%;height:80vh}
.theme-preview-shell.is-mobile .theme-preview-frame{width:420px;max-width:100%;height:80vh}
.theme-preview-frame,.email-preview-frame{width:100%;min-height:540px;border:1px solid var(--theme-border,#ddd);border-radius:18px;background:#fff}
@media (max-width: 1100px){.theme-preview-shell{min-height:72vh}.theme-preview-shell.is-tablet .theme-preview-frame,.theme-preview-shell.is-mobile .theme-preview-frame{width:100%}}
@media (max-width: 760px){.theme-preview-toolbar{flex-direction:column}.theme-preview-shell,.theme-preview-shell.is-desktop .theme-preview-frame,.theme-preview-shell.is-tablet .theme-preview-frame,.theme-preview-shell.is-mobile .theme-preview-frame{min-height:68vh;height:68vh;width:100%}}


.theme-setting-card{padding:12px;border:1px solid var(--border);border-radius:16px;background:#fff}
.theme-setting-title{display:block;font-weight:700;margin-bottom:8px}
.theme-setting-focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(184,109,52,.15)}
.theme-picked-chip{display:inline-block;width:42px;height:42px;border-radius:12px;border:1px solid var(--border)}
.admin-image-preview{grid-column:1/-1}
.admin-image-preview img{width:110px;height:110px;object-fit:cover;border-radius:18px;border:1px solid var(--border)}
