:root {
  --orange: #f26b1d;
  --orange-dark: #c9530f;
  --orange-soft: #fff1e8;
  --ink: #1f2328;
  --muted: #6b7280;
  --line: #ececec;
  --bg: #ffffff;
  --panel: #fafafa;
  --ok: #16794c;
  --err: #b42318;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--orange-dark); }
main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 1.6rem; margin: 0 0 16px; }
h2 { font-size: 1.2rem; margin: 28px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* header */
.site-header { background: var(--bg); border-bottom: 3px solid var(--orange); }
.site-header .inner { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.brand span { color: var(--orange); }
.site-header nav { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; flex: 1; }
.site-header nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-header nav a:hover, .site-header nav a.active { color: var(--orange); }
.site-header .right { margin-left: auto; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--orange); color: #fff; font-size: .75rem; text-align: center; }
.inline-form { display: inline; margin: 0; }

/* buttons */
.btn, button { display: inline-block; border: 1px solid var(--orange); background: var(--orange); color: #fff; padding: 7px 14px; border-radius: var(--radius); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover, button:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.btn.secondary, button.secondary { background: #fff; color: var(--orange-dark); }
.btn.secondary:hover, button.secondary:hover { background: var(--orange-soft); }
.btn.danger, button.danger { background: #fff; color: var(--err); border-color: #f1c0bb; }
.btn.small, button.small { padding: 3px 10px; font-size: .85rem; }
.link-button { background: none; border: none; color: var(--ink); padding: 0; font-weight: 500; }
.link-button:hover { background: none; color: var(--orange); }

/* forms */
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid #d0d5dd; border-radius: 6px; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange-soft); border-color: var(--orange); }
input[type=number] { width: 80px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 20px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 3px; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; }
.field .help { color: var(--muted); font-size: .8rem; }
.errorlist { color: var(--err); margin: 4px 0; padding-left: 18px; font-size: .85rem; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; }
.narrow { max-width: 440px; margin: 20px auto; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--panel); }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.group-header td { background: var(--orange-soft); font-weight: 600; }
tr.text-line td { font-style: italic; color: var(--muted); }
.thumb { display: inline-block; width: 44px; height: 44px; object-fit: contain; border: 1px solid var(--line); border-radius: 4px; background: #fff; vertical-align: middle; }
.thumb.sm { width: 28px; height: 28px; }
.thumb.lg { width: 100%; max-width: 320px; height: auto; aspect-ratio: 1; }
.thumb-empty { background: repeating-linear-gradient(45deg, #fafafa, #fafafa 6px, #f1f1f1 6px, #f1f1f1 12px); }
.note { background: var(--orange-soft); border-left: 3px solid var(--orange); padding: 8px 12px; border-radius: 4px; margin: 10px 0; }
.note-inline { color: var(--orange-dark); font-size: .85rem; }
.llm { background: #f4f5f7; border-left: 3px solid #8b95a5; padding: 8px 12px; border-radius: 4px; margin: 10px 0; font-size: .9rem; }
.llm-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.indent-1 { padding-left: 24px; } .indent-2 { padding-left: 44px; } .indent-3 { padding-left: 64px; } .indent-4 { padding-left: 84px; }

/* messages */
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 8px; background: var(--orange-soft); word-break: break-word; }
.messages li.success { background: #e7f6ee; color: var(--ok); }
.messages li.error { background: #fdecea; color: var(--err); }

/* status pill */
.status { display: inline-block; padding: 1px 10px; border-radius: 12px; font-size: .8rem; font-weight: 600; background: #eef0f3; }
.status-submitted, .status-quoted { background: var(--orange-soft); color: var(--orange-dark); }
.status-confirmed, .status-in_production, .status-ready { background: #e8f0fe; color: #1d4ed8; }
.status-shipped, .status-completed { background: #e7f6ee; color: var(--ok); }
.status-cancelled { background: #fdecea; color: var(--err); }

/* toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
dl.props { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }

/* landing */
.hero { background: linear-gradient(135deg, var(--orange) 0%, #ff9a52 100%); color: #fff; }
.hero .inner { max-width: 1200px; margin: 0 auto; padding: 72px 16px; }
.hero h1 { font-size: 2.4rem; margin-bottom: 12px; }
.hero p { font-size: 1.15rem; max-width: 620px; opacity: .95; }
.hero .btn { background: #fff; color: var(--orange-dark); border-color: #fff; margin-top: 12px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 28px; }
.features .card h3 { margin-top: 0; color: var(--orange-dark); }

/* footer */
.site-footer { background: #1f2328; color: #d0d5dd; margin-top: auto; }
.site-footer .inner { max-width: 1200px; margin: 0 auto; padding: 28px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--orange); }
.site-footer h4 { color: var(--orange); margin: 0 0 8px; font-size: .9rem; text-transform: uppercase; }
.site-footer ul { list-style: none; padding: 0; margin: 0; line-height: 1.9; }
.site-footer .copy { grid-column: 1 / -1; border-top: 1px solid #3a3f45; padding-top: 14px; font-size: .85rem; }
.nowrap { white-space: nowrap; }

/* User view banner */
.user-view-bar { background: #1f2328; color: #fff; border-bottom: 3px solid var(--orange); }
.user-view-bar .inner { max-width: 1200px; margin: 0 auto; padding: 8px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.user-view-bar strong { color: var(--orange); text-transform: uppercase; letter-spacing: .05em; font-size: .85rem; }
.user-view-bar select { padding: 3px 6px; }
.user-view-bar .spacer { flex: 1; }
.muted-light { color: #b8bec7; font-size: .85rem; }

/* blog */
.post { max-width: 760px; }
.post-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin: 8px 0 16px; }
.post-summary { font-size: 1.1rem; color: var(--muted); }
.post-body { font-size: 1.05rem; line-height: 1.7; }
.post-card { display: grid; grid-template-columns: 200px 1fr; gap: 18px; margin-bottom: 14px; align-items: start; }
.post-card:not(:has(img)) { grid-template-columns: 1fr; }
.post-card-cover { width: 100%; aspect-ratio: 1.9; object-fit: cover; border-radius: 6px; display: block; }
@media (max-width: 600px) { .post-card { grid-template-columns: 1fr; } }
.blog-form .field { margin-bottom: 14px; }
.icon { width: 1em; height: 1em; flex: none; }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 32px 0 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.share-label { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 6px; }
.share-btn {
  --brand: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; min-width: 38px; padding: 0 14px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink);
  font: 600 .875rem/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: 0;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.share-btn .icon { width: 17px; height: 17px; color: var(--brand); transition: color .15s; }
.share-btn:hover, .share-btn:focus-visible { background: var(--brand); border-color: var(--brand); color: #fff; }
.share-btn:hover .icon, .share-btn:focus-visible .icon { color: #fff; }
.share-btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.share-linkedin { --brand: #0a66c2; } .share-facebook { --brand: #1877f2; } .share-x { --brand: #000; }
.share-whatsapp { --brand: #1fa855; } .share-reddit { --brand: #ff4500; } .share-email { --brand: #5f6b7a; }
.share-copy, .share-native { --brand: var(--orange-dark); }
.share-copy.is-done { background: var(--ok); border-color: var(--ok); color: #fff; }
.share-copy.is-done .icon { color: #fff; }
@media (max-width: 600px) { .share-btn { padding: 0; width: 42px; height: 42px; } .share-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .share-label { width: 100%; } }

/* rich text (blog body and editor) */
.rich h2 { font-size: 1.4rem; margin: 28px 0 10px; }
.rich h3 { font-size: 1.15rem; margin: 22px 0 8px; }
.rich img { max-width: 100%; height: auto; border-radius: 6px; }
.rich blockquote { margin: 16px 0; padding: 6px 16px; border-left: 3px solid var(--orange); color: var(--muted); }
.rich pre { background: #1f2328; color: #f3f4f6; padding: 12px 14px; border-radius: 6px; overflow-x: auto; font-size: .9rem; }
.rich .ql-align-center { text-align: center; } .rich .ql-align-right { text-align: right; } .rich .ql-align-justify { text-align: justify; }
.rich .ql-indent-1 { padding-left: 2em; } .rich .ql-indent-2 { padding-left: 4em; } .rich .ql-indent-3 { padding-left: 6em; }
.rich-editor { background: #fff; min-height: 360px; font-size: 1rem; }
.rich-editor .ql-editor { min-height: 340px; line-height: 1.7; }
.ql-toolbar.ql-snow { border-radius: 6px 6px 0 0; background: var(--panel); }
.ql-container.ql-snow { border-radius: 0 0 6px 6px; }
.rich-editor-status { min-height: 1.2em; margin-top: 4px; }
.rich-editor-status.error { color: var(--err); }

/* header icons: apps tab, notification bell */
.nav-icon { display: inline-flex; align-items: center; gap: 6px; }
.nav-icon .icon { width: 14px; height: 14px; color: var(--orange); }
.bell { position: relative; display: inline-flex; align-items: center; color: var(--ink); padding: 4px; }
.bell .icon { width: 20px; height: 20px; }
.bell:hover { color: var(--orange); }
.bell-count { position: absolute; top: -4px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--orange); color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }

/* notifications list */
.notif-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.notif a { display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; align-items: start; padding: 12px 8px;
  border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.notif a:hover { background: var(--panel); }
.notif-dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: transparent; }
.notif.is-unread .notif-dot { background: var(--orange); }
.notif:not(.is-unread) strong { font-weight: 500; }
.notif-main { display: flex; flex-direction: column; gap: 2px; }
.notif-body { color: var(--muted); font-size: .9rem; }
.notif-meta { color: var(--muted); font-size: .8rem; white-space: nowrap; }

/* apps */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
.app-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.app-card:hover { border-color: var(--orange); box-shadow: 0 2px 10px rgba(242, 107, 29, .12); }
.app-card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.app-card-text > span:not(.app-card-meta) { color: var(--muted); font-size: .9rem; }
.app-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: .8rem; }
.app-icon { width: 48px; height: 48px; flex: none; border-radius: 12px; object-fit: cover; }
.app-initials { display: inline-flex; align-items: center; justify-content: center; background: var(--orange); color: #fff; font-weight: 800; font-size: 1.1rem; letter-spacing: .02em; }
.run-list { list-style: none; margin: 0; padding: 0; }
.run-list li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.status-queued, .status-sent, .status-running { background: var(--orange-soft); color: var(--orange-dark); }
.status-failed { background: #fdecea; color: var(--err); }

/* excel import */
.import-rows td { vertical-align: top; }
.import-error td { background: #fff7f6; }
.dl-options { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dl-options p { margin: 4px 0 10px; }
@media (max-width: 700px) { .dl-options { grid-template-columns: 1fr; } }
