@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Fraunces:opsz,wght@9..144,600&family=Manrope:wght@400;600;700;800&display=swap');
:root { --paper:#f7f2e9; --ink:#332018; --muted:#8d7466; --line:#e2d3c4; --accent:#d8612d; --green:#4d986d; --card:#fffdf8; }
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; color:var(--ink); background:radial-gradient(circle at 86% 8%, #f7d992 0, transparent 30%), var(--paper); font-family:Manrope, sans-serif; }
button,input,select { font:inherit; }
button { cursor:pointer; }
.admin-shell { width:min(1180px, calc(100% - 48px)); margin:0 auto; padding:48px 0 70px; }
.eyebrow { margin:0 0 12px; color:var(--accent); font:10px 'DM Mono',monospace; letter-spacing:.16em; }
.login-panel { width:min(420px,100%); margin:11vh auto 0; padding:38px; border:1px solid var(--line); border-radius:4px 28px 4px 28px; background:rgba(255,253,248,.88); box-shadow:0 25px 70px rgba(80,45,25,.12); }
.admin-mark { display:grid; width:44px; height:44px; place-items:center; margin-bottom:35px; border-radius:14px 14px 4px 14px; color:#fff8ed; background:var(--accent); font:24px Fraunces,serif; }
h1,h2 { margin:0; font-family:Fraunces,Georgia,serif; font-weight:600; letter-spacing:-.05em; }
.login-panel h1 { font-size:42px; }
.subcopy { margin:11px 0 31px; color:var(--muted); font-size:13px; }
label { display:block; margin-bottom:8px; color:var(--muted); font:10px 'DM Mono',monospace; letter-spacing:.1em; }
input,select { width:100%; min-height:44px; padding:11px 13px; border:1px solid var(--line); border-radius:2px; outline:0; color:var(--ink); background:#fffdf8; }
input:focus,select:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(216,97,45,.12); }
.login-panel button { width:100%; margin-top:13px; padding:13px 16px; border:0; border-radius:3px 14px 3px 14px; color:#fff8ed; background:var(--ink); font-weight:800; }
.login-panel button span { float:right; color:#f5c76d; }
.form-message { min-height:18px; margin:12px 0 0; color:#b34a32; font-size:11px; }
.admin-header { display:flex; align-items:end; justify-content:space-between; padding-bottom:27px; border-bottom:1px solid var(--ink); }
.admin-header h1 { font-size:44px; }
.header-actions { display:flex; align-items:center; gap:9px; color:var(--muted); font:10px 'DM Mono',monospace; text-transform:uppercase; }
.live-dot { width:7px; height:7px; border-radius:50%; background:var(--green); box-shadow:0 0 0 4px rgba(77,152,109,.14); }
.header-actions button,.refresh-button { border:1px solid var(--line); border-radius:999px; padding:8px 13px; color:var(--ink); background:transparent; font-size:11px; }
.metric-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin:26px 0 42px; }
.metric-grid article { min-height:135px; padding:19px; border:1px solid var(--line); background:rgba(255,253,248,.7); }
.metric-grid span,.metric-grid small { display:block; color:var(--muted); font-size:11px; }
.metric-grid strong { display:block; margin:15px 0 3px; font:34px Fraunces,serif; }
.metric-grid small { font-size:10px; }
.orders-panel { border-top:1px solid var(--ink); }
.panel-head { display:flex; align-items:end; justify-content:space-between; margin:26px 0 20px; }
.panel-head h2 { font-size:32px; }
.filters { display:flex; gap:10px; margin-bottom:14px; }
.filters input { max-width:390px; }
.filters select { width:160px; }
.table-wrap { overflow-x:auto; border:1px solid var(--line); background:rgba(255,253,248,.7); }
table { width:100%; border-collapse:collapse; min-width:760px; font-size:12px; }
th { padding:12px 15px; border-bottom:1px solid var(--ink); color:var(--muted); font:9px 'DM Mono',monospace; letter-spacing:.08em; text-align:left; }
td { padding:15px; border-bottom:1px solid var(--line); vertical-align:top; }
tbody tr:last-child td { border-bottom:0; }
.order-id,.masked { font-family:'DM Mono',monospace; font-size:10px; }
.order-email { font-weight:700; }
.state { display:inline-block; padding:4px 7px; background:#e5f1e6; color:#34734c; font:9px 'DM Mono',monospace; }
.state.processing,.state.queued { background:#fff0d0; color:#99611f; }
.state.failed { background:#f8dfd7; color:#a8412f; }
.empty { padding:35px; color:var(--muted); text-align:center; }
.privacy-note { margin:12px 0 0; color:var(--muted); font-size:10px; }
.mail-panel { margin-top:52px; border-top:1px solid var(--ink); }
.mail-status-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:0 0 26px; }
.mail-status-grid article { min-height:108px; padding:18px; border:1px solid var(--line); background:rgba(255,253,248,.7); }
.mail-status-grid article span,.mail-status-grid article small { display:block; color:var(--muted); font-size:11px; }
.mail-status-grid article strong { display:block; margin:12px 0 4px; font:600 22px Fraunces,serif; }
.mail-status-grid article strong.is-ready { color:var(--green); }
.mail-status-grid article strong.is-missing { color:var(--accent); }
.mail-editor { display:grid; gap:13px; max-width:820px; }
.mail-editor textarea { width:100%; min-height:190px; padding:11px 13px; border:1px solid var(--line); border-radius:2px; outline:0; color:var(--ink); background:#fffdf8; resize:vertical; line-height:1.6; }
.mail-editor textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(216,97,45,.12); }
.template-vars { display:flex; align-items:center; flex-wrap:wrap; gap:7px; color:var(--muted); font-size:11px; }
.template-vars code { padding:4px 7px; border:1px solid var(--line); color:var(--accent); background:#fffaf0; font:10px 'DM Mono',monospace; }
.mail-actions { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding-top:7px; }
.mail-actions .form-message { margin:0; }
.mail-resend { margin-top:7px; padding:4px 7px; border:1px solid var(--line); border-radius:999px; color:var(--ink); background:transparent; font-size:10px; }
.mail-resend:hover { border-color:var(--accent); color:var(--accent); }
.mail-state { display:inline-block; padding:4px 7px; background:#fff0d0; color:#99611f; font:9px 'DM Mono',monospace; }
.mail-state.sent { background:#e5f1e6; color:#34734c; }
.mail-state.failed { background:#f8dfd7; color:#a8412f; }
.mail-state.unconfigured { background:#eee8df; color:var(--muted); }
.content-panel { margin-top:52px; border-top:1px solid var(--ink); }
.save-state { color:var(--muted); font:10px 'DM Mono',monospace; }
.editor-section { padding:25px 0 30px; border-bottom:1px solid var(--line); }
.editor-section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:22px; margin-bottom:19px; }
.editor-section h3 { margin:0 0 5px; font:600 26px Fraunces,Georgia,serif; letter-spacing:-.045em; }
.editor-section-head p { margin:0; color:var(--muted); font-size:11px; line-height:1.6; }
.editor-fields { display:grid; gap:12px; }
.editor-fields.two-col { grid-template-columns:repeat(2,minmax(0,1fr)); }
.editor-section label { margin:0 0 13px; }
.editor-section textarea { width:100%; min-height:90px; padding:11px 13px; border:1px solid var(--line); border-radius:2px; outline:0; color:var(--ink); background:#fffdf8; resize:vertical; line-height:1.6; }
.editor-section textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(216,97,45,.12); }
.block-toolbar { display:flex; flex-wrap:wrap; gap:8px; margin:3px 0 13px; }
.secondary-action { padding:8px 11px; border:1px solid var(--line); border-radius:999px; color:var(--ink); background:transparent; font-size:11px; }
.secondary-action:hover { border-color:var(--accent); color:var(--accent); background:#fff7e9; }
.upload-row { display:flex; align-items:end; flex-wrap:wrap; gap:10px; margin:4px 0 17px; padding:12px; border:1px dashed var(--line); background:rgba(255,253,248,.45); transition:border-color .2s ease, background .2s ease, box-shadow .2s ease; }
.upload-row.is-dragging { border-color:var(--accent); background:#fff4df; box-shadow:0 0 0 3px rgba(216,97,45,.1), inset 0 0 0 1px var(--accent); }
.upload-field { flex:1 1 330px; margin:0 !important; cursor:pointer; }
.upload-title { display:block; margin-bottom:4px; color:var(--ink); font:700 11px Manrope,sans-serif; letter-spacing:0; }
.upload-hint { display:block; margin-bottom:8px; color:var(--muted); font:10px 'DM Mono',monospace; letter-spacing:0; text-transform:none; }
.upload-field input { min-height:40px; padding:8px 10px; font:11px Manrope,sans-serif; }
.upload-button { min-height:40px; white-space:nowrap; }
.upload-button:disabled { cursor:wait; opacity:.55; }
.upload-status { min-width:110px; color:var(--muted); font:10px 'DM Mono',monospace; }
.block-list { display:grid; gap:10px; }
.content-block { padding:14px; border:1px solid var(--line); background:rgba(255,253,248,.7); }
.content-block-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.content-block-label { color:var(--accent); font:9px 'DM Mono',monospace; letter-spacing:.12em; text-transform:uppercase; }
.content-block-actions { display:flex; gap:4px; }
.content-block-actions button { width:27px; height:27px; padding:0; border:1px solid var(--line); border-radius:50%; color:var(--muted); background:transparent; font-size:12px; }
.content-block-actions button:hover { border-color:var(--accent); color:var(--accent); }
.content-block-grid { display:grid; grid-template-columns:minmax(0,1fr) 160px; gap:10px; }
.content-block input,.content-block select { min-height:40px; }
.content-block textarea { min-height:74px; margin:0; }
.content-block .full { grid-column:1/-1; }
.announcement-editor { padding-top:30px; }
.toggle-line { display:flex !important; align-items:center; gap:8px; color:var(--ink) !important; font:700 11px Manrope,sans-serif !important; }
.toggle-line input { width:16px; min-height:16px; accent-color:var(--accent); }
.content-actions { display:flex; align-items:center; gap:16px; padding-top:23px; }
.save-button { padding:13px 17px; border:0; border-radius:3px 14px 3px 14px; color:#fff8ed; background:var(--ink); font-weight:800; }
.save-button span { float:right; margin-left:28px; color:#f5c76d; }
.save-button:hover { background:#5b3020; }
.content-actions .form-message { margin:0; }
[hidden] { display:none !important; }
@media (max-width:700px) { .admin-shell { width:min(100% - 30px, 1180px); padding-top:24px; } .login-panel { margin-top:8vh; padding:27px; } .admin-header { align-items:flex-start; flex-direction:column; gap:20px; } .admin-header h1 { font-size:36px; } .metric-grid { grid-template-columns:repeat(2,1fr); } .mail-status-grid { grid-template-columns:1fr; } .filters { flex-direction:column; } .filters input,.filters select { max-width:none; width:100%; } .editor-fields.two-col,.content-block-grid { grid-template-columns:1fr; } .content-block .full { grid-column:auto; } .editor-section-head { flex-direction:column; } .content-actions { align-items:stretch; flex-direction:column; } .content-actions .save-button { width:100%; } .mail-actions { align-items:stretch; flex-direction:column; } .mail-actions button { width:100%; } .upload-row { align-items:stretch; flex-direction:column; } .upload-field { flex-basis:auto; } .upload-button { width:100%; } }
