.blog-shell { width: min(980px, 92vw); margin: 32px auto; }
.blog-form { display: grid; gap: 10px; }
.blog-form input:not([type="checkbox"]):not([type="radio"]), .blog-form textarea, .blog-form select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(4, 13, 29, 0.75);
  color: var(--text);
  padding: 10px;
}

body[data-theme="white"] .blog-form input:not([type="checkbox"]):not([type="radio"]),
body[data-theme="white"] .blog-form textarea,
body[data-theme="white"] .blog-form select {
  background: #f7fbff;
  color: #123058;
  border-color: rgba(45, 104, 173, 0.35);
}

body[data-theme="white"] .blog-form input:not([type="checkbox"]):not([type="radio"])::placeholder,
body[data-theme="white"] .blog-form textarea::placeholder {
  color: #587395;
  opacity: 1;
}
.blog-list { display: grid; gap: 12px; }
.blog-item {
  background: linear-gradient(170deg, rgba(8,24,58,.84), var(--panel));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.blog-public .blog-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.blog-public .blog-item {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.blog-cover-top {
  width: 100% !important;
  height: 210px !important;
  object-fit: cover;
  margin: 0 0 10px;
  border-radius: 10px;
}
.blog-intro {
  margin: 6px 0 2px;
  line-height: 1.55;
}
.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 4px;
}
.blog-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .78rem;
  line-height: 1;
  border: 1px solid var(--line);
  background: rgba(13, 35, 76, 0.55);
  color: var(--text);
}
.blog-post-page {
  max-width: 980px;
  margin: 0 auto;
}
.blog-post-back-wrap {
  margin-bottom: 12px;
}
.blog-post-card {
  padding: 20px;
}
.blog-post-card h1 {
  margin-top: 4px;
}
.blog-post-cover {
  height: auto !important;
  max-height: 420px;
  object-fit: cover;
}
body[data-theme="white"] .blog-item {
  background: linear-gradient(170deg, #f7fbff, #edf4ff);
  border-color: rgba(45, 104, 173, 0.28);
  color: #123058;
}
body[data-theme="white"] .blog-item h1,
body[data-theme="white"] .blog-item h2,
body[data-theme="white"] .blog-item h3,
body[data-theme="white"] .blog-item h4,
body[data-theme="white"] .blog-item p,
body[data-theme="white"] .blog-item li,
body[data-theme="white"] .blog-item .blog-content {
  color: #123058;
}
body[data-theme="white"] .blog-item .blog-meta {
  color: #4f6f96;
}
body[data-theme="white"] .blog-tag {
  background: #eaf3ff;
  color: #123058;
  border-color: rgba(45, 104, 173, 0.3);
}
.blog-meta { color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.blog-actions { display: flex; gap: 8px; margin-top: 10px; }
.blog-actions button { cursor: pointer; }
#blogForm .blog-actions {
  margin-top: 0;
  align-items: center;
}
#blogForm .blog-actions input {
  flex: 1;
}
#blogForm .blog-actions select {
  min-width: 220px;
}
.blog-linkedin-at,
.blog-linkedin-custom {
  width: 100%;
  margin-top: 8px;
}
.blog-linkedin-custom {
  min-height: 72px;
}
.linkedin-card {
  margin: 12px 0 18px;
}
.security-card {
  margin-bottom: 18px;
}
.blog-editor {
  background: rgba(4, 13, 29, 0.75);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
}
.blog-editor .ql-editor {
  color: var(--text);
}
.blog-editor .ql-toolbar {
  border: 0;
  border-bottom: 1px solid var(--line);
}
.blog-editor .ql-container {
  border: 0;
  min-height: 260px;
  font-family: 'Manrope', sans-serif;
}
body[data-theme="white"] .blog-editor {
  background: #f7fbff;
  border-color: rgba(45, 104, 173, 0.35);
  color: #123058;
}
body[data-theme="white"] .blog-editor .ql-toolbar {
  background: #eef5ff;
  border-bottom-color: rgba(45, 104, 173, 0.28);
}
body[data-theme="white"] .blog-editor .ql-container {
  background: #f7fbff;
}
body[data-theme="white"] .blog-editor .ql-editor {
  color: #123058;
}
body[data-theme="white"] .blog-editor .ql-editor.ql-blank::before {
  color: #587395;
  opacity: 1;
}
body[data-theme="white"] .blog-editor .ql-stroke {
  stroke: #2f4d78;
}
body[data-theme="white"] .blog-editor .ql-fill {
  fill: #2f4d78;
}
body[data-theme="white"] .blog-editor .ql-picker,
body[data-theme="white"] .blog-editor .ql-picker-label,
body[data-theme="white"] .blog-editor .ql-picker-item,
body[data-theme="white"] .blog-editor .ql-formats button {
  color: #2f4d78;
}
body[data-theme="white"] .blog-editor .ql-picker-options {
  background: #ffffff;
  border-color: rgba(45, 104, 173, 0.28);
}
.blog-content {
  line-height: 1.7;
}
.blog-content.ql-editor {
  padding: 0;
  border: 0;
  background: transparent;
}
.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
  margin: .72em 0 .32em;
  line-height: 1.22;
  font-family: Orbitron, sans-serif;
  letter-spacing: .01em;
}
.blog-content p {
  margin: 0;
}
.blog-content p + p {
  margin-top: .38em;
}
.blog-content ul,
.blog-content ol {
  margin: .45em 0 .85em;
  padding-left: 1.45em;
}
.blog-content li {
  margin: .14em 0;
}
.blog-content blockquote {
  margin: .55em 0;
  padding: .45em .9em;
  border-left: 3px solid var(--cyan);
  background: rgba(20, 42, 80, 0.35);
  border-radius: 0 8px 8px 0;
}
.blog-post-card .blog-content,
.blog-item .blog-content {
  font-size: 1rem;
}
.blog-post-card .blog-content p,
.blog-post-card .blog-content li,
.blog-post-card .blog-content blockquote {
  line-height: 1.45;
}
.blog-content pre,
.blog-editor .ql-editor pre {
  margin: .95em 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #061126;
  color: #d7ebff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .9rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}
.blog-content pre code,
.blog-editor .ql-editor pre code {
  background: transparent;
  padding: 0;
  border: 0;
  color: inherit;
  font-family: inherit;
}
.blog-content pre[data-code-lang]::before,
.blog-editor .ql-editor pre[data-code-lang]::before {
  content: attr(data-code-lang);
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(112, 212, 255, .2);
  color: #9dd6ff;
  font-size: .72rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.blog-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 10px 0;
}
.blog-content .blog-video-embed {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(4, 13, 29, 0.45);
}
.blog-content .blog-video-embed iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}
.blog-content .blog-video-embed video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75vh;
  background: #000;
}
body[data-theme="white"] .blog-content blockquote {
  background: #e9f2ff;
}
body[data-theme="white"] .blog-content pre,
body[data-theme="white"] .blog-editor .ql-editor pre {
  background: #f1f7ff;
  color: #123058;
  border-color: rgba(45, 104, 173, 0.35);
}
body[data-theme="white"] .blog-content pre[data-code-lang]::before,
body[data-theme="white"] .blog-editor .ql-editor pre[data-code-lang]::before {
  background: rgba(47, 137, 255, .14);
  color: #1e4f8d;
}
.blog-editor .ql-editor img.editor-image-selected {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.editor-image-handle {
  position: fixed;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--cyan);
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
  cursor: nwse-resize;
  z-index: 9999;
}
.editor-image-handle[hidden] {
  display: none;
}
.blog-cover,
.cover-preview {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin: 8px 0 10px;
}
.cover-resize-box {
  width: 420px;
  height: 240px;
  max-width: 100%;
  min-width: 180px;
  min-height: 120px;
  resize: both;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(4, 13, 29, 0.45);
}
.cover-resize-box .cover-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  margin: 0;
  border-radius: 8px;
}
.blog-admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
#loginError { color: #ffb8b8; }

.portal-menu {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.portal-menu-btn {
  border: 1px solid var(--line);
  background: rgba(4, 13, 29, 0.75);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
body[data-theme="white"] .portal-menu-btn {
  background: #eef5ff;
  color: #173a65;
  border-color: rgba(45, 104, 173, 0.35);
}
.portal-menu-btn.active {
  background: linear-gradient(130deg, var(--cyan), #8ec5ff, var(--mint));
  color: #021526;
  border-color: transparent;
  font-weight: 700;
}
.portal-tab {
  display: none;
}
.portal-tab.active {
  display: block;
}
.manage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.manage-card {
  background: linear-gradient(170deg, rgba(8,24,58,.84), var(--panel));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
body[data-theme="white"] .manage-card {
  background: linear-gradient(170deg, #f7fbff, #edf4ff);
  border-color: rgba(45, 104, 173, 0.28);
  color: #123058;
}
.manage-card > h3 {
  margin-top: 0;
  margin-bottom: 8px;
}
.manage-card .blog-form {
  gap: 8px;
  margin-bottom: 8px;
}
.manage-card .blog-form input,
.manage-card .blog-form textarea,
.manage-card .blog-form select {
  padding: 8px;
  font-size: .92rem;
}
.manage-card .blog-form input[type="checkbox"],
.manage-card .blog-form input[type="radio"] {
  width: auto;
  padding: 0;
}
.manage-card #orderMailTemplateForm {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.manage-card #orderMailTemplateForm input,
.manage-card #orderMailTemplateForm textarea {
  max-width: 100%;
}
.manage-card #orderMailTemplateForm textarea {
  resize: vertical;
  min-height: 220px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.order-template-help {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.template-help-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.template-help-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: fixed;
}
.template-help-table th,
.template-help-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.template-help-table th {
  color: var(--muted);
  font-size: .84rem;
  letter-spacing: .01em;
}
.template-help-table tr:last-child td {
  border-bottom: 0;
}
.template-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin: 2px 6px 2px 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(47, 137, 255, 0.12);
  font-size: .8rem;
}
.template-pill.is-unknown {
  background: rgba(255, 110, 110, 0.15);
  border-color: rgba(255, 110, 110, 0.45);
}
.template-warn {
  color: #c24747;
  font-weight: 600;
}
body[data-theme="white"] .template-pill {
  background: rgba(47, 137, 255, 0.12);
  border-color: rgba(45, 104, 173, 0.35);
}
body[data-theme="white"] .template-warn {
  color: #a33333;
}
.manage-card .blog-meta {
  margin: 4px 0 8px;
}
.btn-compact {
  padding: 7px 10px;
  border-radius: 9px;
  font-size: .86rem;
}
.manage-card-full {
  grid-column: 1 / -1;
}
.collapsible-card {
  margin: 10px 0;
}
.collapsible-toggle {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(6, 18, 42, 0.72);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
}
.collapsible-toggle::after {
  content: "▾";
  float: right;
  opacity: .85;
}
.collapsible-toggle.is-open::after {
  content: "▴";
}
.collapsible-body {
  padding-top: 8px;
}

.blog-item-compact {
  padding: 10px;
}
.order-compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(4, 44px);
  gap: 8px;
  align-items: center;
}
.order-compact-row > * {
  min-width: 0;
}
.order-title-input {
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 10px;
}
.order-compact-row .btn {
  white-space: nowrap;
  padding: 7px 10px;
}
.order-icon-btn {
  min-width: 44px;
  width: 44px;
  height: 44px;
  justify-self: center;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}
.order-status-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 174, 255, 0.95) rgba(9, 29, 58, 0.35);
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(91, 174, 255, 0.25);
}
.order-scroll-hint {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .01em;
}
.order-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.order-column > h3 {
  margin: 0 0 8px;
}
.order-admin-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
  min-width: 0;
}
.order-admin-column > h4 {
  margin: 0 0 8px;
  font-family: Orbitron, sans-serif;
  color: var(--muted);
}
.order-admin-column {
  min-width: 0;
}
.order-admin-column .blog-item {
  margin-bottom: 10px;
}
.order-admin-column .blog-item:last-child {
  margin-bottom: 0;
}
.order-status-table-wrap::-webkit-scrollbar {
  height: 12px;
}
.order-status-table-wrap::-webkit-scrollbar-track {
  background: rgba(9, 29, 58, 0.35);
  border-radius: 999px;
}
.order-status-table-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(96, 173, 255, 0.98), rgba(93, 234, 201, 0.95));
  border-radius: 999px;
  border: 2px solid rgba(9, 29, 58, 0.45);
}
.order-status-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.95rem;
  line-height: 1.35;
}
.order-status-table th,
.order-status-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 12px;
  text-align: left;
  vertical-align: middle;
  box-sizing: border-box;
  word-break: normal;
  overflow-wrap: normal;
}
.order-status-table th {
  font-family: Orbitron, sans-serif;
  font-size: 0.82rem;
  letter-spacing: .02em;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.order-status-table td {
  color: var(--text);
}
.order-status-table .col-customer { width: 190px; }
.order-status-table .col-order { width: 180px; }
.order-status-table .col-description { width: 300px; }
.order-status-table .col-status { width: 140px; }
.order-status-table .col-updated { width: 140px; }
.order-status-table .col-delivery { width: 170px; }
.order-status-table .col-tracking { width: 175px; }
.order-status-table .col-invoice { width: 100px; text-align: center; }
.order-status-table td.col-order,
.order-status-table td.col-updated,
.order-status-table td.col-delivery {
  white-space: nowrap;
}
.order-status-table td.col-description,
.order-status-table td.col-tracking {
  white-space: normal;
  overflow-wrap: anywhere;
}
.order-status-table td.col-invoice {
  text-align: center;
}
.order-status-table th.col-invoice {
  text-align: center;
}
.order-invoice-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 1rem;
}
.order-status-table tr:last-child td {
  border-bottom: 0;
}
.order-status-toggle-btn {
  min-width: 210px;
}
#customerPanel #orderStatusPanel,
#customerPanel #orderList,
#customerPanel .order-columns,
#customerPanel .order-column,
#customerPanel .order-status-table-wrap {
  width: 100%;
  max-width: 100%;
}
#customerPanel #orderList.blog-list {
  display: block;
}
#customerPanel .order-status-table-wrap {
  display: block;
  box-sizing: border-box;
  overflow-x: auto;
}
#customerPanel #exportOrdersBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  min-width: 210px;
  min-height: 40px;
  padding-inline: 16px;
}
.blog-item-compact.is-archived {
  opacity: .7;
  border-style: dashed;
}
.perf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 16px 0 18px;
}
.perf-item h3 {
  margin: 0 0 4px;
}
.site-stats-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.site-stats-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  min-width: 360px;
}
.site-stats-table th,
.site-stats-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.site-stats-table th {
  font-size: .92rem;
  letter-spacing: .01em;
  color: var(--muted);
}
.site-stats-table tr:last-child td {
  border-bottom: 0;
}
.site-stats-table .col-count {
  text-align: right;
  white-space: nowrap;
}
.perf-ok {
  border-color: rgba(69,255,138,.45);
}
.perf-warn {
  border-color: rgba(255,196,84,.5);
}
.perf-bad {
  border-color: rgba(255,110,110,.6);
}

#tab-performance > .blog-actions {
  gap: 12px;
  margin: 12px 0 14px;
  flex-wrap: wrap;
}

#tab-performance > .blog-actions .btn {
  flex: 1 1 240px;
  min-width: 220px;
  text-align: center;
  justify-content: center;
}

#tab-performance .manage-card {
  margin-top: 18px;
}

#tab-performance #perfActionsWrap {
  margin-top: 16px;
}

#tab-performance #perfActionsWrap .manage-card + .manage-card {
  margin-top: 18px;
}

#tab-performance #perfActionsWrap .manage-card h3 {
  margin-bottom: 10px;
}

body[data-theme="white"] .collapsible-toggle {
  background: #edf4ff;
  color: #123058;
  border-color: rgba(45, 104, 173, 0.35);
}

@media (max-width: 900px) {
  .order-status-table .col-customer { width: 180px; }
  .order-status-table .col-order { width: 180px; }
  .order-status-table .col-description { width: 280px; }
  .order-status-table .col-status { width: 140px; }
  .order-status-table .col-updated { width: 140px; }
  .order-status-table .col-delivery { width: 170px; }
  .order-status-table .col-tracking { width: 180px; }
  .order-status-table .col-invoice { width: 100px; }
  .order-status-table {
    min-width: 1020px;
  }
  .order-status-table td.col-order,
  .order-status-table td.col-updated,
  .order-status-table td.col-delivery {
    white-space: normal;
  }
  .order-columns {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .order-admin-columns { gap: 12px; }
  .blog-public .blog-list {
    grid-template-columns: 1fr;
  }
  .order-compact-row {
    grid-template-columns: minmax(0, 1fr) repeat(4, 40px);
    gap: 6px;
  }
  .order-icon-btn {
    min-width: 40px;
    width: 40px;
    height: 40px;
    font-size: .95rem;
  }
  #tab-performance > .blog-actions {
    gap: 10px;
    margin: 10px 0 12px;
  }

  #tab-performance > .blog-actions .btn {
    flex: 1 1 100%;
    min-width: 0;
  }
}

#emailSettingsForm {
  gap: 12px;
  max-width: 720px;
}

#emailSettingsForm .form-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
}

#emailSettingsForm .form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
  margin: 0;
}

#emailSettingsForm input[type="password"],
#emailSettingsForm input[type="email"],
#emailSettingsForm input[type="text"] {
  padding: 11px 12px;
}

body[data-theme="white"] #emailSettingsForm input[type="password"],
body[data-theme="white"] #emailSettingsForm input[type="email"],
body[data-theme="white"] #emailSettingsForm input[type="text"] {
  background: #f7fbff;
  color: #123058;
  border-color: rgba(45, 104, 173, 0.35);
}

body[data-theme="white"] #emailSettingsForm input[type="password"]::placeholder,
body[data-theme="white"] #emailSettingsForm input[type="email"]::placeholder,
body[data-theme="white"] #emailSettingsForm input[type="text"]::placeholder {
  color: #587395;
  opacity: 1;
}
@media (max-width: 900px) {
  .manage-grid {
    grid-template-columns: 1fr;
  }
  .manage-card-full {
    grid-column: auto;
  }
}
