* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
       background: #f2f3f5; color: #1c1e21; font-size: 15px; }
a { color: #2456c8; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 18px 0 12px; }
h2 { font-size: 16px; margin: 18px 0 8px; }

.topbar { background: #16181d; color: #fff; display: flex; align-items: center;
          padding: 0 16px; flex-wrap: wrap; }
.topbar .brand { font-weight: 700; font-size: 17px; padding: 14px 18px 14px 0; }
.topbar .brand span { color: #6ea8fe; }
.topbar nav a { color: #c8cbd2; padding: 14px 12px; display: inline-block; }
.topbar nav a.active, .topbar nav a:hover { color: #fff; text-decoration: none; }

main { max-width: 1050px; margin: 0 auto; padding: 8px 16px 60px; }

.card { background: #fff; border: 1px solid #e2e4e8; border-radius: 10px;
        padding: 16px 18px; margin: 14px 0; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.center-page { display: block; }

label { display: block; margin: 10px 0; font-weight: 600; font-size: 14px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 10px;
        border: 1px solid #c8ccd4; border-radius: 7px; font-size: 15px; font-family: inherit;
        font-weight: 400; background: #fff; }
input[type=file] { border: none; padding-left: 0; }
label.check { font-weight: 400; }
label.check input { display: inline; width: auto; margin-right: 6px; }
.hint { display: block; font-weight: 400; color: #7a7f88; font-size: 12.5px; margin-top: 3px; }

button, .btn { background: #2456c8; color: #fff; border: none; border-radius: 7px;
        padding: 10px 16px; font-size: 14.5px; cursor: pointer; margin-top: 8px; }
button:hover, .btn:hover { background: #1c46a6; text-decoration: none; }
button:disabled { background: #aab2c0; cursor: not-allowed; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn-green { background: #1f8a4c; } .btn-green:hover { background: #197340; }
.btn-red { background: #c23b3b; } .btn-red:hover { background: #a52f2f; }

.flash { padding: 11px 14px; border-radius: 8px; margin: 12px 0; font-size: 14.5px; }
.flash.ok { background: #e2f3e8; color: #1a5c35; border: 1px solid #bfe3cc; }
.flash.err { background: #fbe4e4; color: #8c2323; border: 1px solid #f0c4c4; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 10px; }
.stat { background: #fff; border: 1px solid #e2e4e8; border-radius: 10px; text-align: center; padding: 12px 6px; }
.stat b { display: block; font-size: 20px; }
.stat span { color: #7a7f88; font-size: 12.5px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.toolbar button { margin-top: 0; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { flex: 1; min-width: 160px; margin: 6px 0; }
.inline-form select, .inline-form input { width: 100%; }
.inline-form button { white-space: nowrap; }

.grid-form label { max-width: 480px; }

table.leads { width: 100%; border-collapse: collapse; background: #fff;
        border: 1px solid #e2e4e8; border-radius: 10px; overflow: hidden; }
table.leads th { text-align: left; font-size: 12.5px; text-transform: uppercase; color: #7a7f88;
        padding: 10px 12px; border-bottom: 1px solid #e2e4e8; }
table.leads td { padding: 10px 12px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
td.thumb img { width: 54px; height: 54px; object-fit: contain; background: #f4f5f7;
        border-radius: 7px; border: 1px solid #e2e4e8; }
.small { font-size: 12.5px; }
.muted { color: #7a7f88; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.b-new { background: #e7edfb; color: #24439c; }
.b-approved { background: #e2f3e8; color: #1a5c35; }
.b-rejected { background: #f0f1f3; color: #6a6f78; }
.b-sent { background: #fdf1dc; color: #8a5a12; }
.b-replied { background: #eae3fa; color: #4f2f9e; }
.b-unsubscribed { background: #fbe4e4; color: #8c2323; }

.progress { background: #fff; border: 1px solid #e2e4e8; border-radius: 10px;
        padding: 12px 16px; margin: 10px 0; font-size: 14px; }
.hidden { display: none; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

.logo-preview img { max-width: 200px; max-height: 140px; background:
        repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 20px 20px;
        border: 1px solid #e2e4e8; border-radius: 8px; padding: 8px; }
.mockup-preview img { max-width: 100%; width: 380px; border-radius: 8px; border: 1px solid #e2e4e8; }

ol li { margin: 6px 0; }

/* ---------- shirts library ---------- */
.shirt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.shirt-card { margin: 0; text-align: center; }
.shirt-card img { width: 100%; height: 170px; object-fit: contain; background: #f4f5f7;
        border-radius: 8px; border: 1px solid #e2e4e8; margin-bottom: 8px; }
.shirt-card.inactive { opacity: 0.5; }
.shirt-card b { display: block; font-size: 14px; margin-bottom: 4px; }
.shirt-actions { margin-top: 10px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.shirt-actions form { margin: 0; }
.shirt-actions button { margin-top: 0; }
.swatch { display: inline-block; width: 11px; height: 11px; border-radius: 3px;
        border: 1px solid #c8ccd4; vertical-align: middle; margin-right: 3px; }

/* ---------- print area editor ---------- */
.editor-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
@media (max-width: 820px) { .editor-wrap { grid-template-columns: 1fr; } }

.editor-stage { position: relative; display: inline-block; line-height: 0;
        background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 24px 24px;
        border: 1px solid #e2e4e8; border-radius: 8px; overflow: hidden; width: 100%; }
.editor-stage img { width: 100%; display: block; user-select: none; -webkit-user-drag: none; }

.pbox { position: absolute; border: 2px solid #2456c8; background: rgba(36, 86, 200, 0.14);
        cursor: move; box-sizing: border-box; touch-action: none; }
.pbox-label { position: absolute; top: -1px; left: -1px; background: #2456c8; color: #fff;
        font-size: 10.5px; line-height: 1.5; padding: 1px 5px; border-radius: 0 0 5px 0;
        white-space: nowrap; font-family: -apple-system, sans-serif; }
.pbox-handle { position: absolute; right: -7px; bottom: -7px; width: 15px; height: 15px;
        background: #fff; border: 2px solid #2456c8; border-radius: 50%; cursor: nwse-resize; }

.editor-side h2 { margin-top: 0; }
.area-row { border: 1px solid #e2e4e8; border-radius: 8px; padding: 9px 11px; margin-bottom: 8px; }
.area-row b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.area-row button { margin-top: 6px; }

/* ---------- mockup studio ---------- */
.ms { margin-top: 10px; }
.ms-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ms-bar button { margin-top: 0; }
.ms-suggest { margin: 8px 0; }
.ms-suggest button { margin-top: 0; margin-left: 6px; }

#msSearch { margin: 8px 0 6px; }

.ms-list { max-height: 190px; overflow-y: auto; border: 1px solid #e2e4e8;
        border-radius: 8px; padding: 5px; background: #fff; }
.ms-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
        background: none; color: #1c1e21; border: none; border-radius: 6px;
        padding: 6px 8px; margin: 0; font-size: 13px; cursor: pointer; }
.ms-item:hover { background: #eef1f6; }
.ms-item.active { background: #e7edfb; font-weight: 600; }
.ms-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-dot { width: 13px; height: 13px; border-radius: 50%; border: 1px solid #c8ccd4; flex: none; }

.ms-stage { margin: 12px 0; text-align: center; background: #f4f5f7;
        border: 1px solid #e2e4e8; border-radius: 8px; padding: 10px; min-height: 90px; }
.ms-stage canvas { max-width: 100%; border-radius: 6px; touch-action: none; cursor: move; }

.ms-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ms-presets button { margin-top: 0; background: #eef1f6; color: #2b2f38; }
.ms-presets button:hover { background: #dde3ee; }

.ms-status { font-size: 13px; color: #1a5c35; min-height: 18px; margin-top: 6px; }
.ms-status.err { color: #8c2323; }

.ms-fallback { margin-top: 16px; border-top: 1px solid #eef0f3; padding-top: 10px; }
.ms-fallback summary { cursor: pointer; }

/* ---------- bulk select and cleanup ---------- */
.bulkbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
        background: #fff; border: 1px solid #e2e4e8; border-radius: 10px;
        padding: 9px 14px; margin-bottom: 10px; }
.bulkbar label.check { margin: 0; }
.bulkbar button { margin-top: 0; }
table.leads td.tick, table.leads th.tick { width: 34px; padding-right: 0; }
table.leads td.tick input { width: auto; margin: 0; }

.cleanup summary { cursor: pointer; }
.cleanup-row { display: flex; align-items: center; justify-content: space-between;
        gap: 12px; border-top: 1px solid #eef0f3; padding: 8px 0; margin: 0; }
.cleanup-row button { margin-top: 0; }
