*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w: 260px;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --bg: #f8fafc;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-hover: #334155;
  --sidebar-active: #2563eb;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 6px;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); }

.hidden { display: none !important; }

/* LOGIN */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--sidebar-bg); }
.login-box { background: #fff; border-radius: 12px; padding: 40px; width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-box h1 { font-size: 22px; text-align: center; color: var(--text); }
.login-box input { padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 15px; outline: none; }
.login-box input:focus { border-color: var(--accent); }
.login-box button { padding: 11px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius); font-size: 15px; cursor: pointer; }
.login-box button:hover { background: var(--accent-hover); }
.error-msg { background: #fee2e2; color: var(--danger); padding: 10px 14px; border-radius: var(--radius); font-size: 14px; }

/* LAYOUT */
#app { display: flex; min-height: 100vh; }

/* SIDEBAR */
#sidebar { width: var(--sidebar-w); background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }

.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 14px; border-bottom: 1px solid #334155; }
.logo { font-size: 16px; font-weight: 600; color: #f1f5f9; }
.sidebar-header button { background: none; border: none; color: var(--sidebar-text); cursor: pointer; font-size: 18px; padding: 2px 4px; border-radius: 4px; }
.sidebar-header button:hover { background: var(--sidebar-hover); }

#search-box { padding: 10px 12px; border-bottom: 1px solid #334155; }
#search-input { width: 100%; padding: 7px 10px; background: #334155; border: none; border-radius: var(--radius); color: #f1f5f9; font-size: 14px; outline: none; }
#search-input::placeholder { color: #94a3b8; }

#category-tree { flex: 1; padding: 8px 0; }

.tree-item { display: block; }
.tree-label { display: flex; align-items: center; gap: 6px; padding: 7px 16px; font-size: 14px; cursor: pointer; color: var(--sidebar-text); border-radius: 0; transition: background 0.15s; user-select: none; }
.tree-label:hover { background: var(--sidebar-hover); }
.tree-label.active { background: var(--sidebar-active); color: #fff; }
.tree-label .arrow { font-size: 10px; transition: transform 0.2s; margin-left: auto; }
.tree-label.open .arrow { transform: rotate(90deg); }
.tree-children { padding-left: 16px; display: none; }
.tree-children.open { display: block; }
.tree-children .tree-label { font-size: 13px; padding-left: 20px; }

.admin-link { display: flex; align-items: center; gap: 6px; padding: 9px 16px; font-size: 13px; color: #94a3b8; cursor: pointer; border-top: 1px solid #334155; }
.admin-link:hover { color: #f1f5f9; background: var(--sidebar-hover); }

.sidebar-footer { padding: 12px 16px; border-top: 1px solid #334155; display: flex; align-items: center; gap: 8px; font-size: 13px; }
#user-name { flex: 1; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#user-role-badge { background: #334155; color: #94a3b8; padding: 2px 7px; border-radius: 10px; font-size: 11px; }
#logout-btn { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 18px; }
#logout-btn:hover { color: #f1f5f9; }

/* MAIN */
#main { flex: 1; padding: 32px 40px; max-width: 900px; overflow: hidden; }
#main.fullwidth { padding: 0; max-width: none; display: flex; flex-direction: column; }

.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; display: flex; gap: 6px; align-items: center; }
.breadcrumb span { cursor: pointer; }
.breadcrumb span:hover { color: var(--accent); }
.breadcrumb .sep { color: #cbd5e1; }

.view-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; gap: 12px; }
.view-header h2 { font-size: 22px; }

/* BUTTONS */
.btn-primary { background: var(--accent); color: #fff; border: none; padding: 8px 16px; border-radius: var(--radius); cursor: pointer; font-size: 14px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); padding: 8px 16px; border-radius: var(--radius); cursor: pointer; font-size: 14px; }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: #fff; border: none; padding: 6px 12px; border-radius: var(--radius); cursor: pointer; font-size: 13px; }
.btn-danger:hover { opacity: 0.85; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* WELCOME */
#welcome-view h2 { font-size: 24px; margin-bottom: 8px; }
#welcome-view p { color: var(--text-muted); margin-bottom: 28px; }
#recent-articles { display: grid; gap: 12px; }

/* ARTICLE LIST */
#article-list { display: flex; flex-direction: column; gap: 1px; }
.article-card { padding: 14px 18px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: border-color 0.15s; }
.article-card:hover { border-color: var(--accent); }
.article-card.draft { opacity: 0.6; }
.article-card-title { font-size: 15px; font-weight: 500; }
.article-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.article-card-right { display: flex; gap: 8px; align-items: center; }
.badge-draft { background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.badge-pub { background: #dcfce7; color: #166534; padding: 2px 8px; border-radius: 10px; font-size: 11px; }

/* ARTICLE VIEW */
.article-meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.article-actions { display: flex; gap: 8px; }

/* MARKDOWN */
.markdown-body { font-size: 15px; line-height: 1.7; color: var(--text); }
.markdown-body h1 { font-size: 24px; margin: 24px 0 12px; }
.markdown-body h2 { font-size: 20px; margin: 20px 0 10px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.markdown-body h3 { font-size: 17px; margin: 16px 0 8px; }
.markdown-body p { margin-bottom: 12px; }
.markdown-body ul, .markdown-body ol { padding-left: 24px; margin-bottom: 12px; }
.markdown-body li { margin-bottom: 4px; }
.markdown-body code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: 'Fira Code', monospace; }
.markdown-body pre { background: #1e293b; color: #e2e8f0; padding: 16px; border-radius: var(--radius); overflow-x: auto; margin-bottom: 14px; }
.markdown-body pre code { background: none; color: inherit; padding: 0; }
.markdown-body blockquote { border-left: 3px solid var(--accent); padding-left: 14px; color: var(--text-muted); margin-bottom: 12px; }
.markdown-body table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.markdown-body th { background: var(--bg); font-weight: 600; }
.markdown-body a { color: var(--accent); }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* EDITOR */
.editor-title-input { width: 100%; font-size: 22px; font-weight: 600; border: none; border-bottom: 2px solid var(--border); padding: 8px 0; margin-bottom: 14px; outline: none; background: transparent; }
.editor-title-input:focus { border-bottom-color: var(--accent); }
#editor-cat-select-wrap { margin-bottom: 14px; font-size: 14px; }
#editor-cat-select-wrap select { margin-left: 8px; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.publish-toggle { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.editor-actions { display: flex; align-items: center; gap: 12px; }

/* QUILL */
#quill-editor { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
#quill-editor .ql-toolbar { border: none; border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; background: var(--bg); padding: 8px; }
#quill-editor .ql-container { border: none; font-size: 15px; min-height: 65vh; }
#quill-editor .ql-editor { min-height: 65vh; padding: 20px 24px; line-height: 1.7; }
#quill-editor .ql-editor img { max-width: 100%; border-radius: var(--radius); margin: 8px 0; }
#quill-editor .ql-editor h1 { font-size: 26px; margin: 16px 0 8px; }
#quill-editor .ql-editor h2 { font-size: 21px; margin: 14px 0 6px; }
#quill-editor .ql-editor h3 { font-size: 17px; margin: 12px 0 5px; }
#quill-editor .ql-editor blockquote { border-left: 3px solid var(--accent); padding-left: 14px; color: var(--text-muted); }
#quill-editor .ql-editor pre { background: #1e293b; color: #e2e8f0; padding: 14px; border-radius: var(--radius); }

/* Article content from Quill HTML */
.article-body { font-size: 15px; line-height: 1.7; }
.article-body img { max-width: 100%; border-radius: var(--radius); margin: 8px 0; }
.article-body h1 { font-size: 26px; margin: 20px 0 10px; }
.article-body h2 { font-size: 21px; margin: 18px 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.article-body h3 { font-size: 17px; margin: 14px 0 6px; }
.article-body p { margin-bottom: 10px; }
.article-body ul, .article-body ol { padding-left: 24px; margin-bottom: 10px; }
.article-body li { margin-bottom: 3px; }
.article-body blockquote { border-left: 3px solid var(--accent); padding-left: 14px; color: var(--text-muted); margin-bottom: 10px; }
.article-body pre { background: #1e293b; color: #e2e8f0; padding: 14px; border-radius: var(--radius); overflow-x: auto; margin-bottom: 12px; }
.article-body code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.article-body pre code { background: none; color: inherit; padding: 0; }
.article-body a { color: var(--accent); }
.article-body table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.article-body th { background: var(--bg); font-weight: 600; }

/* ADMIN */
.admin-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.admin-tab { background: none; border: none; padding: 10px 20px; font-size: 14px; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.tab-header h3 { font-size: 18px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: var(--bg); font-weight: 600; color: var(--text-muted); }
tr:hover td { background: #f8fafc; }

.role-badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.role-admin { background: #fce7f3; color: #9d174d; }
.role-editor { background: #e0f2fe; color: #075985; }
.role-employee { background: #dcfce7; color: #166534; }
.role-intern { background: #f3f4f6; color: #374151; }

.cat-admin-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 6px; }
.cat-admin-name { flex: 1; font-size: 14px; }
.cat-admin-slug { font-size: 12px; color: var(--text-muted); }

/* PERMISSIONS MATRIX */
.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table th, .perm-table td { padding: 8px 12px; border: 1px solid var(--border); text-align: center; }
.perm-table th { background: var(--bg); }
.perm-table td:first-child { text-align: left; font-weight: 500; }
.perm-cell { cursor: pointer; user-select: none; }
.perm-allow { color: var(--success); font-weight: 600; }
.perm-deny { color: var(--danger); font-weight: 600; }
.perm-default { color: #94a3b8; }
.hint { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.perm-sub { padding-left: 20px !important; }

/* MODAL */
#modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }
#modal-box { background: #fff; border-radius: 10px; padding: 28px; width: 440px; max-width: 95vw; }
#modal-title { font-size: 17px; font-weight: 600; margin-bottom: 18px; }
#modal-body { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
#modal-body input, #modal-body select { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }
#modal-body label { font-size: 13px; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }
#modal-footer { display: flex; justify-content: flex-end; gap: 10px; }

.empty-state { padding: 40px; text-align: center; color: var(--text-muted); }

/* PROCESSES */
.process-card { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; margin-bottom: 10px; cursor: pointer; transition: box-shadow 0.15s; }
.process-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.process-card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.process-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.process-card-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Process editor */
#process-editor-view { display: flex; flex-direction: column; height: calc(100vh - 0px); }
#process-editor-view.hidden { display: none !important; }
.swimlane-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--border); flex-wrap: wrap; flex-shrink: 0; }
.swimlane-toolbar-sep { width: 1px; height: 24px; background: var(--border); margin: 0 2px; }
.toolbar-label { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.process-title-input { padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; font-weight: 600; min-width: 200px; outline: none; }
.process-title-input:focus { border-color: var(--accent); }
.block-type-btn { padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: #f8fafc; font-size: 13px; cursor: pointer; white-space: nowrap; }
.block-type-btn:hover { background: #e2e8f0; }
.block-type-btn.active-tool { background: var(--accent); color: #fff; border-color: var(--accent); }
.swimlane-hint { padding: 6px 16px; font-size: 12px; color: var(--text-muted); background: #fefce8; border-bottom: 1px solid #fef08a; flex-shrink: 0; }
#swimlane-canvas-wrap { flex: 1; overflow: auto; background: #e8ecf0; }
#swimlane-svg { display: block; }
.block:hover .block-port { opacity: 1 !important; }

/* Block popup */
.block-popup { position: fixed; z-index: 500; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px; width: 290px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); display: flex; flex-direction: column; gap: 10px; }
.block-popup-header { display: flex; justify-content: space-between; align-items: center; }
.block-popup-header strong { font-size: 14px; color: var(--text); }
.block-popup-header button { background: none; border: none; cursor: pointer; font-size: 16px; color: var(--text-muted); padding: 0 4px; }
.block-popup label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-muted); }
.block-popup input[type="text"], .block-popup select { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; outline: none; }
.block-popup input[type="text"]:focus, .block-popup select:focus { border-color: var(--accent); }
.block-popup-add-role { display: flex; gap: 6px; }
.block-popup-add-role input { flex: 1; min-width: 0; }
.block-popup-add-role button { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: #f8fafc; font-size: 13px; cursor: pointer; white-space: nowrap; }
.block-popup-add-role button:hover { background: #e2e8f0; }
/* Collapsible sections */
.block-popup-section { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.block-popup-section summary { padding: 7px 10px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); user-select: none; list-style: none; display: flex; align-items: center; gap: 6px; }
.block-popup-section summary::-webkit-details-marker { display: none; }
.block-popup-section summary::before { content: '▶'; font-size: 10px; color: var(--text-muted); transition: transform 0.15s; margin-right: 2px; }
.block-popup-section[open] summary::before { transform: rotate(90deg); }
.section-badge { background: var(--accent); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 6px; font-weight: 600; margin-left: auto; }
/* Description */
.block-desc-wrap { padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 4px; }
.block-desc-wrap textarea { resize: none; height: 72px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; font-family: inherit; line-height: 1.45; outline: none; width: 100%; box-sizing: border-box; transition: height 0.2s; }
.block-desc-wrap textarea:focus { border-color: var(--accent); }
.block-desc-wrap textarea.expanded { height: 180px; }
.block-expand-btn { align-self: flex-end; background: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 2px 8px; font-size: 13px; cursor: pointer; color: var(--text-muted); line-height: 1.6; }
.block-expand-btn:hover { background: #f1f5f9; }
/* Images */
.block-images-wrap { padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.block-images-grid { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.block-img-thumb { position: relative; width: 64px; height: 64px; border-radius: 4px; overflow: hidden; cursor: pointer; border: 1px solid var(--border); flex-shrink: 0; }
.block-img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.block-img-thumb .img-del { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,0.55); color: #fff; border: none; border-radius: 3px; font-size: 10px; line-height: 1; padding: 2px 4px; cursor: pointer; opacity: 0; transition: opacity 0.1s; }
.block-img-thumb:hover .img-del { opacity: 1; }
.img-upload-label { display: inline-block; padding: 6px 12px; border: 1px dashed var(--border); border-radius: var(--radius); font-size: 13px; color: var(--text-muted); cursor: pointer; }
.img-upload-label:hover { border-color: var(--accent); color: var(--accent); }
/* Lightbox */
.img-lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.img-lightbox-bg { position: absolute; inset: 0; background: rgba(0,0,0,0.78); }
.img-lightbox img { position: relative; max-width: 90vw; max-height: 88vh; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
#img-lightbox-close { position: absolute; top: 16px; right: 20px; background: rgba(255,255,255,0.15); border: none; border-radius: 50%; color: #fff; font-size: 18px; width: 36px; height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 1; }
#img-lightbox-close:hover { background: rgba(255,255,255,0.3); }
.btn-danger { padding: 7px 14px; background: var(--danger); color: #fff; border: none; border-radius: var(--radius); font-size: 14px; cursor: pointer; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ===== OFFERS ===== */
.offers-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.offers-tab { background: none; border: none; padding: 9px 18px; font-size: 14px; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.offers-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.offers-tab-content { }
.offer-search-input { width: 100%; max-width: 480px; padding: 10px 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; outline: none; margin-bottom: 16px; display: block; }
.offer-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.offer-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.offer-card-info { flex: 1; }
.offer-card-name { font-weight: 600; font-size: 15px; color: var(--text); }
.offer-card-meta { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.offer-level-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.offer-level-jun { background: #dcfce7; color: #166534; }
.offer-level-mid { background: #fef9c3; color: #854d0e; }
.offer-level-sin { background: #ede9fe; color: #5b21b6; }
.offer-card-url { font-size: 12px; color: var(--accent); cursor: pointer; text-decoration: underline; }
.offer-editor-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.offer-editor-meta label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-muted); }
.offer-editor-meta select { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; outline: none; min-width: 160px; }
.offer-editor-meta select:focus { border-color: var(--accent); }
#offer-quill-editor { height: calc(100vh - 260px); overflow-y: auto; }
#offer-quill-editor .ql-container { height: 100%; overflow-y: auto; }
#offer-quill-editor .ql-editor { min-height: 100%; font-size: 15px; line-height: 1.7; }
.offer-editor-mode-bar { display: flex; gap: 4px; margin-bottom: 8px; }
.offer-mode-btn { padding: 5px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: #f8fafc; font-size: 13px; cursor: pointer; color: var(--text-muted); }
.offer-mode-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.offer-html-textarea { width: 100%; height: calc(100vh - 260px); padding: 12px; font-family: 'Courier New', monospace; font-size: 13px; line-height: 1.6; border: 1px solid var(--border); border-radius: var(--radius); resize: vertical; outline: none; background: #1e1e2e; color: #cdd6f4; box-sizing: border-box; }
.offer-html-textarea:focus { border-color: var(--accent); }
.cta-html-textarea { height: 280px; }

/* Blocks list */
.offer-block-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.offer-block-card-info { flex: 1; font-size: 15px; }
.offer-block-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Block section on public offer page */
.offer-block-section { background: #f8fafc; border-radius: 10px; padding: 24px 28px; margin-bottom: 28px; border: 1px solid #e2e8f0; }
.offer-block-section h1, .offer-block-section h2 { color: #0f172a; margin-top: 16px; margin-bottom: 8px; }
.offer-block-section h1:first-child, .offer-block-section h2:first-child { margin-top: 0; }
.offer-block-section ul { padding-left: 22px; }
.offer-block-section li { margin-bottom: 4px; }

/* CTA editor section */
.cta-editor-section { margin-top: 32px; padding-top: 24px; border-top: 2px solid var(--border); }
.cta-editor-heading { font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 16px; }
.cta-editor-meta { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.cta-editor-meta label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-muted); }
.cta-editor-meta input[type="text"] { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; outline: none; min-width: 200px; }
.cta-editor-meta input[type="text"]:focus { border-color: var(--accent); }
.cta-color-wrap { display: flex; gap: 6px; align-items: center; }
.cta-color-wrap input[type="color"] { width: 40px; height: 34px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; padding: 2px; background: none; }
.cta-color-wrap input[type="text"] { min-width: 90px !important; font-family: monospace; }
.cta-editor-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 12px; }
#cta-quill-editor { border: 1px solid var(--border); border-radius: var(--radius); }
#cta-quill-editor .ql-editor { min-height: 160px; font-size: 15px; line-height: 1.7; }

/* CTA sticky button */
.offer-cta-btn { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%); padding: 16px 40px; border: none; border-radius: 50px; font-size: 17px; font-weight: 700; color: #fff; cursor: pointer; box-shadow: 0 4px 24px rgba(0,0,0,0.2); z-index: 100; transition: transform 0.15s, box-shadow 0.15s; white-space: nowrap; }
.offer-cta-btn:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.25); }

/* CTA popup */
.offer-cta-popup { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.offer-cta-popup.hidden { display: none; }
.offer-cta-popup-bg { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.offer-cta-popup-box { position: relative; background: #fff; border-radius: 16px; box-shadow: 0 8px 48px rgba(0,0,0,0.18); max-width: 640px; width: 90%; max-height: 80vh; overflow-y: auto; padding: 40px 48px; }
.offer-cta-popup-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 20px; cursor: pointer; color: #94a3b8; line-height: 1; }
.offer-cta-popup-close:hover { color: #334155; }
#offer-cta-popup-content { font-size: 15px; line-height: 1.75; color: #334155; padding: 0; }
#offer-cta-popup-content h1, #offer-cta-popup-content h2 { color: #0f172a; margin-top: 20px; margin-bottom: 8px; }
#offer-cta-popup-content ul { padding-left: 22px; }
#offer-cta-popup-content li { margin-bottom: 5px; }
@media (max-width: 600px) { .offer-cta-btn { bottom: 20px; padding: 13px 28px; font-size: 15px; } .offer-cta-popup-box { padding: 28px 20px; } }

/* ===== PUBLIC OFFERS LIST ===== */
#offer-list-public-page { min-height: 100vh; background: #f8fafc; }
.offer-list-wrap { max-width: 860px; margin: 0 auto; padding: 48px 24px; }
.offer-list-header { margin-bottom: 28px; }
.offer-list-header h1 { font-size: 28px; font-weight: 800; color: #0f172a; margin-bottom: 6px; }
.offer-list-header p { color: #64748b; font-size: 15px; }
.offer-list-filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.offer-list-filters select { padding: 9px 14px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 14px; background: #fff; color: #0f172a; outline: none; min-width: 180px; cursor: pointer; }
.offer-list-filters select:focus { border-color: #2563eb; }
.offer-list-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 18px 22px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; transition: box-shadow 0.15s; }
.offer-list-card:hover { box-shadow: 0 2px 12px rgba(37,99,235,0.1); border-color: #93c5fd; }
.offer-list-card-info { flex: 1; }
.offer-list-card-title { font-weight: 600; font-size: 16px; color: #0f172a; }
.offer-list-card-meta { font-size: 13px; color: #64748b; margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.offer-list-empty { text-align: center; padding: 60px 20px; color: #94a3b8; font-size: 15px; }
.offer-list-card a.btn-open { display: inline-block; padding: 8px 18px; background: #2563eb; color: #fff; border-radius: 7px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.offer-list-card a.btn-open:hover { background: #1d4ed8; }

/* ===== PUBLIC OFFER PAGE ===== */
.offer-doc-wrap { min-height: 100vh; background: #f8fafc; padding: 40px 20px; display: flex; justify-content: center; }
.offer-doc { background: #fff; max-width: 780px; width: 100%; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.08); padding: 56px 64px; }
.offer-doc-badge { display: inline-block; background: #ede9fe; color: #5b21b6; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 12px; border-radius: 20px; margin-bottom: 20px; }
.offer-doc-title { font-size: 32px; font-weight: 800; color: #0f172a; margin: 0 0 8px; }
.offer-doc-subtitle { font-size: 16px; color: #64748b; margin-bottom: 0; }
.offer-doc-divider { border: none; border-top: 2px solid #e2e8f0; margin: 28px 0; }
.offer-doc-content { font-size: 15px; line-height: 1.75; color: #334155; }
.offer-doc-content h1, .offer-doc-content h2 { color: #0f172a; margin-top: 28px; margin-bottom: 10px; }
.offer-doc-content h3 { color: #1e293b; margin-top: 20px; margin-bottom: 6px; }
.offer-doc-content ul { padding-left: 22px; }
.offer-doc-content li { margin-bottom: 6px; }
.offer-doc-not-found { text-align: center; padding: 80px 20px; color: #64748b; }
.offer-doc-not-found h2 { font-size: 24px; margin-bottom: 8px; }
@media (max-width: 600px) { .offer-doc { padding: 28px 20px; } .offer-doc-title { font-size: 24px; } }
