:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;

  --text: #172033;
  --text-soft: #64748b;

  --border: #dbe3ee;
  --border-strong: #cbd5e1;

  --primary: #1769aa;
  --primary-hover: #125487;

  --danger: #b42318;

  --radius: 12px;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}


* {
  box-sizing: border-box;
}


body {
  margin: 0;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  background:
    var(--bg);

  color:
    var(--text);

  line-height: 1.5;
}


/* ==============================
   KHUNG CHÍNH
   ============================== */

.container {
  width: 100%;

  max-width: 1400px;

  margin:
    0 auto;

  padding:
    32px;
}


.container>h1 {
  margin:
    0 0 6px;

  font-size:
    30px;

  line-height:
    1.2;
}


.container>h1+p {
  margin:
    0 0 28px;

  color:
    var(--text-soft);

  font-size:
    15px;
}


/* ==============================
   KHU VỰC / MODULE
   ============================== */

section {
  margin:
    0 0 24px;

  padding:
    24px;

  background:
    var(--surface);

  border:
    1px solid var(--border);

  border-radius:
    var(--radius);

  box-shadow:
    var(--shadow);
}


section h2 {
  margin:
    0 0 20px;

  font-size:
    22px;
}


section h3 {
  margin:
    28px 0 14px;

  font-size:
    17px;
}


section p {
  margin:
    10px 0;
}


/* ==============================
   FORM
   ============================== */

label {
  display:
    block;

  margin-bottom:
    6px;

  font-size:
    14px;

  font-weight:
    600;

  color:
    #334155;
}


input,
select,
textarea {
  width:
    100%;

  max-width:
    520px;

  padding:
    10px 12px;

  border:
    1px solid var(--border-strong);

  border-radius:
    8px;

  background:
    #ffffff;

  color:
    var(--text);

  font:
    inherit;
}


textarea {
  max-width:
    100%;

  min-height:
    90px;

  resize:
    vertical;
}


input:focus,
select:focus,
textarea:focus {
  outline:
    none;

  border-color:
    var(--primary);

  box-shadow:
    0 0 0 3px rgba(23, 105, 170, 0.12);
}


form>div,
section>div {
  margin-bottom:
    12px;
}


/* ==============================
   BUTTON
   ============================== */

button {
  min-height:
    38px;

  margin:
    4px 6px 4px 0;

  padding:
    9px 14px;

  border:
    1px solid var(--border-strong);

  border-radius:
    8px;

  background:
    #ffffff;

  color:
    var(--text);

  font-weight:
    600;

  cursor:
    pointer;

  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.05s ease;
}


button:hover {
  background:
    #f1f5f9;

  border-color:
    #94a3b8;
}


button:active {
  transform:
    translateY(1px);
}


button:disabled {
  opacity:
    0.55;

  cursor:
    not-allowed;
}


/* Nút thao tác chính */

form button[type="submit"],
#aiGenerateCaptionButton,
#aiSaveDraftButton,
#aiAddPresetButton {
  border-color:
    var(--primary);

  background:
    var(--primary);

  color:
    #ffffff;
}


form button[type="submit"]:hover,
#aiGenerateCaptionButton:hover,
#aiSaveDraftButton:hover,
#aiAddPresetButton:hover {
  background:
    var(--primary-hover);
}


/* ==============================
   ĐƯỜNG PHÂN CÁCH
   ============================== */

hr {
  margin:
    28px 0;

  border:
    0;

  border-top:
    1px solid var(--border);
}


/* ==============================
   PRODUCT / DANH SÁCH CHUNG
   ============================== */

.product {
  padding:
    14px 0;

  border-bottom:
    1px solid var(--border);
}


.product:last-child {
  border-bottom:
    0;
}


/* ==============================
   AI CONTENT
   ============================== */

#aiCaptionOutput {
  min-height:
    220px;

  padding:
    14px;

  background:
    var(--surface-soft);
}


#aiPresetButtons {
  display:
    flex;

  flex-wrap:
    wrap;

  gap:
    6px;
}


#aiPresetManageList,
#aiDraftList {
  margin-top:
    14px;
}


/* ==============================
   PUBLISHING
   ============================== */

#publishingOverview {
  display:
    grid;

  grid-template-columns:
    repeat(auto-fit,
      minmax(160px, 1fr));

  gap:
    12px;

  margin:
    16px 0 24px;
}


#publishingOverview>div {
  margin:
    0;

  padding:
    14px;

  background:
    var(--surface-soft);

  border:
    1px solid var(--border);

  border-radius:
    9px;
}


#publishingAlertList,
#publishingApprovedList,
#publishingJobList {
  margin-top:
    12px;
}


#publishingJobDetail {
  margin-top:
    16px;

  padding:
    18px;

  background:
    var(--surface-soft);

  border:
    1px solid var(--border);

  border-radius:
    10px;
}


/* ==============================
   AUTH
   ============================== */

#authSection {
  max-width:
    520px;
}


#authResult {
  color:
    var(--text-soft);
}


/* ==============================
   DEV / LAB
   ============================== */

#appWorkspace[hidden],
#developerToolsSection[hidden] {
  display:
    none;
}


#developerToolsSection {
  margin-top:
    32px;

  padding:
    20px;

  background:
    #fffdf5;

  border:
    1px dashed #d4a72c;

  border-radius:
    var(--radius);
}


.dev-mode-header {
  display:
    flex;

  justify-content:
    space-between;

  align-items:
    center;

  gap:
    12px;

  margin-bottom:
    16px;
}


#devModeStatus {
  padding:
    5px 9px;

  border-radius:
    999px;

  background:
    #fef3c7;

  font-size:
    12px;

  font-weight:
    700;
}


#status {
  margin-top:
    20px;
}


/* ==============================
   MÀN HÌNH NHỎ
   ============================== */

@media (max-width: 768px) {

  .container {
    padding:
      16px;
  }


  section {
    padding:
      18px;
  }


  .container>h1 {
    font-size:
      25px;
  }


  input,
  select,
  textarea {
    max-width:
      100%;
  }


  button {
    max-width:
      100%;
  }

}

/* ==============================
   HANA APP SHELL
   ============================== */

.hana-app-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 720px;
  overflow: clip;

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 16px;

  box-shadow: var(--shadow);
}


.hana-sidebar {
  display: flex;
  flex-direction: column;

  position: sticky;
  top: 24px;
  align-self: start;

  height: calc(100vh - 48px);
  min-height: 0;

  padding: 20px 14px;

  background: #152238;
  color: #ffffff;
}


.hana-sidebar-brand {
  display: flex;
  align-items: center;

  gap: 10px;

  padding: 4px 8px 22px;
}


.hana-sidebar-brand strong {
  display: block;

  font-size: 14px;
  letter-spacing: 0.03em;
}


.hana-sidebar-brand small {
  display: block;

  margin-top: 2px;

  color: #aebbd0;

  font-size: 12px;
}


.hana-brand-mark {
  display: grid;
  place-items: center;

  width: 38px;
  height: 38px;

  flex: 0 0 38px;

  border-radius: 10px;

  background: #ffffff;
  color: #152238;

  font-size: 19px;
  font-weight: 800;
}


.hana-nav {
  display: flex;
  flex-direction: column;

  gap: 5px;
}


.hana-nav-button {
  width: 100%;
  min-height: 44px;

  margin: 0;
  padding: 0 14px;

  border: 0;
  border-radius: 9px;

  background: transparent;
  color: #d7e0ed;

  text-align: left;

  font-size: 14px;
  font-weight: 600;
}


.hana-nav-button:hover {
  border: 0;

  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}


.hana-nav-button.active {
  background: #ffffff;
  color: #152238;
}


.hana-sidebar-footer {
  margin-top: auto;

  padding: 18px 10px 2px;

  color: #8797ad;

  font-size: 12px;
}


.hana-main {
  min-width: 0;

  background: var(--bg);
}


.hana-page-header {
  display: flex;

  position: sticky;
  top: 0;
  z-index: 20;

  justify-content: space-between;
  align-items: center;

  min-height: 96px;

  padding: 20px 28px;

  background: var(--surface);

  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}


.hana-page-header h2 {
  margin: 4px 0 4px;

  font-size: 25px;
}


.hana-page-header p {
  margin: 0;

  color: var(--text-soft);
}


.hana-page-eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.05em;
}


.hana-view-host {
  padding: 28px;
}


.hana-view-host>hr {
  display: none;
}


.hana-order-workspace {
  margin: 0;
  padding: 0;

  background: transparent;

  border: 0;
  border-radius: 0;

  box-shadow: none;
}


.hana-order-workspace>hr {
  display: none;
}


.hana-order-workspace>h2 {
  margin: 0 0 18px;
}


.hana-module-card {
  margin: 0 0 20px;

  padding: 24px;

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 12px;

  box-shadow: var(--shadow);
}


form.hana-module-card {
  display: block;
}

/* BUSINESS FORM WIDTH */
#orderForm > div,
#customerForm > div,
#productForm > div {
  width: 100%;
  max-width: 720px;
}


#orderForm input,
#orderForm select,
#customerForm input,
#customerForm textarea,
#productForm input {
  max-width: none;
}


@media (max-width: 900px) {

  .hana-app-shell {
    grid-template-columns: 1fr;
  }


  .hana-sidebar {
    position: static;

    height: auto;
    min-height: auto;
  }


  .hana-nav {
    display: grid;

    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }


  .hana-sidebar-footer {
    display: none;
  }


  .hana-view-host {
    padding: 18px;
  }


  .hana-page-header {
    padding: 20px;
  }

}

/* ==============================
   AUTH COMPACT AFTER LOGIN
   ============================== */

#authSection.auth-compact {
  display: flex;

  align-items: center;
  justify-content: flex-end;

  max-width: none;

  margin: 0 0 20px;

  padding: 10px 14px;

  background: transparent;

  border: 0;

  border-radius: 0;

  box-shadow: none;
}


#authSection.auth-compact>h2,
#authSection.auth-compact #authForm,
#authSection.auth-compact #authResult {
  display: none;
}


#authSection.auth-compact #authCurrentUser {
  margin: 0;

  padding: 7px 12px;

  background: #ffffff;

  border: 1px solid var(--border);

  border-radius: 999px;

  color: var(--text-soft);

  font-size: 13px;

  font-weight: 600;
}

/* ==============================
   AUTHENTICATED APP HEADER
   ============================== */

body.hana-authenticated .container>h1,

body.hana-authenticated .container>h1+p,

body.hana-authenticated #authSection.auth-compact,

body.hana-authenticated #authSection.auth-compact+hr {
  display: none;
}


.hana-header-user {
  flex: 0 0 auto;

  margin-left: 24px;

  padding: 8px 12px;

  background: var(--surface-soft);

  border: 1px solid var(--border);

  border-radius: 999px;

  color: var(--text-soft);

  font-size: 13px;
  font-weight: 600;

  white-space: nowrap;
}


@media (max-width: 700px) {

  .hana-page-header {
    align-items: flex-start;
    flex-direction: column;

    gap: 14px;
  }


  .hana-header-user {
    margin-left: 0;
  }

}

/* ==============================
   CUSTOMER CARDS
   ============================== */

.customer-card-list {
  display: grid;
  gap: 14px;

  margin-top: 18px;
}


.customer-card {
  padding: 18px 20px;

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 12px;

  box-shadow:
    0 1px 4px rgba(15, 23, 42, 0.04);
}


.customer-card-header {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 16px;
}


.customer-title-block {
  display: flex;

  align-items: center;

  min-width: 0;

  gap: 10px;
}


.customer-card-id {
  flex: 0 0 auto;

  padding: 3px 7px;

  background: var(--surface-soft);

  border: 1px solid var(--border);
  border-radius: 6px;

  color: var(--text-soft);

  font-size: 12px;
  font-weight: 700;
}


.customer-card-name {
  overflow: hidden;

  color: var(--text);

  font-size: 17px;

  text-overflow: ellipsis;

  white-space: nowrap;
}


.customer-status-badge {
  flex: 0 0 auto;

  padding: 5px 9px;

  border-radius: 999px;

  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.03em;
}


.customer-status-badge.is-active {
  background: #ecfdf3;

  border: 1px solid #abefc6;

  color: #067647;
}


.customer-status-badge.is-inactive {
  background: #f2f4f7;

  border: 1px solid #d0d5dd;

  color: #475467;
}


.customer-card-meta {
  display: grid;

  grid-template-columns:
    minmax(180px, 240px) minmax(0, 1fr);

  gap: 12px 24px;

  margin-top: 14px;

  padding: 13px 0;

  color: var(--text-soft);

  font-size: 14px;
}


.customer-meta-item {
  min-width: 0;
}


.customer-note {
  overflow-wrap: anywhere;
}


.customer-card-actions {
  display: flex;

  align-items: center;

  flex-wrap: wrap;

  gap: 8px;

  padding-top: 14px;

  border-top: 1px solid var(--border);
}


.customer-card-actions button {
  margin: 0;
}


.customer-action-primary {
  border-color: var(--primary);

  background: var(--primary);

  color: #ffffff;
}


.customer-action-primary:hover {
  border-color: var(--primary-hover);

  background: var(--primary-hover);

  color: #ffffff;
}


.customer-action-danger {
  margin-left: auto !important;

  border-color: #fecdca;

  background: #ffffff;

  color: #b42318;
}


.customer-action-danger:hover {
  border-color: #fda29b;

  background: #fff5f4;

  color: #912018;
}


.customer-orders {
  margin-top: 14px;

  padding: 14px;

  background: var(--surface-soft);

  border: 1px solid var(--border);
  border-radius: 9px;
}


@media (max-width: 700px) {

  .customer-card-header {
    align-items: flex-start;

    flex-direction: column;
  }


  .customer-card-meta {
    grid-template-columns: 1fr;
  }


  .customer-action-danger {
    margin-left: 0 !important;
  }

}
/* ==============================
   PRODUCT CARDS
   ============================== */

#productManagementList {
  display: grid;

  gap: 14px;

  margin-top: 18px;
}


.product-card {
  padding: 18px 20px;

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 12px;

  box-shadow:
    0 1px 4px rgba(15, 23, 42, 0.04);
}


.product-card > div {
  margin-bottom: 0;
}


.product-card-header {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 16px;
}


.product-title-block {
  display: flex;

  align-items: center;

  min-width: 0;

  gap: 10px;
}


.product-card-id {
  flex: 0 0 auto;

  padding: 3px 7px;

  background: var(--surface-soft);

  border: 1px solid var(--border);
  border-radius: 6px;

  color: var(--text-soft);

  font-size: 12px;
  font-weight: 700;
}


.product-card-name {
  overflow: hidden;

  color: var(--text);

  font-size: 17px;

  text-overflow: ellipsis;

  white-space: nowrap;
}


.product-status-badge {
  flex: 0 0 auto;

  padding: 5px 9px;

  border-radius: 999px;

  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.03em;
}


.product-status-badge.is-active {
  background: #ecfdf3;

  border: 1px solid #abefc6;

  color: #067647;
}


.product-status-badge.is-inactive {
  background: #f2f4f7;

  border: 1px solid #d0d5dd;

  color: #475467;
}


.product-card-price {
  margin-top: 14px !important;
  margin-bottom: 14px !important;

  color: var(--text-soft);

  font-size: 14px;
  font-weight: 600;
}


.product-card-actions {
  display: flex;

  align-items: center;

  flex-wrap: wrap;

  gap: 8px;

  padding-top: 14px;

  border-top: 1px solid var(--border);
}


.product-card-actions button {
  margin: 0;
}


.product-action-primary {
  border-color: var(--primary);

  background: var(--primary);

  color: #ffffff;
}


.product-action-primary:hover {
  border-color: var(--primary-hover);

  background: var(--primary-hover);

  color: #ffffff;
}


.product-action-danger {
  margin-left: auto !important;

  border-color: #fecdca;

  background: #ffffff;

  color: #b42318;
}


.product-action-danger:hover {
  border-color: #fda29b;

  background: #fff5f4;

  color: #912018;
}


@media (max-width: 700px) {

  .product-card-header {
    align-items: flex-start;

    flex-direction: column;
  }


  .product-action-danger {
    margin-left: 0 !important;
  }

}
/* ==============================
   ORDER CARDS
   ============================== */

#orderList {
  display: grid;
  gap: 14px;

  margin-top: 18px;
}


.order-card {
  padding: 18px 20px;

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 12px;

  box-shadow:
    0 1px 4px rgba(15, 23, 42, 0.04);
}


.order-card > div {
  margin-bottom: 0;
}


.order-card-header {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 16px;
}


.order-title-block {
  display: flex;

  align-items: center;

  min-width: 0;

  gap: 10px;
}


.order-card-id {
  flex: 0 0 auto;

  padding: 3px 7px;

  background: var(--surface-soft);

  border: 1px solid var(--border);
  border-radius: 6px;

  color: var(--text-soft);

  font-size: 12px;
  font-weight: 700;
}


.order-card-customer {
  overflow: hidden;

  color: var(--text);

  font-size: 17px;

  text-overflow: ellipsis;

  white-space: nowrap;
}


.order-status-badge {
  flex: 0 0 auto;

  padding: 5px 9px;

  border-radius: 999px;

  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.03em;
}


.order-status-badge.status-new {
  background: #eff8ff;
  border: 1px solid #b2ddff;
  color: #175cd3;
}


.order-status-badge.status-confirmed {
  background: #f9f5ff;
  border: 1px solid #d6bbfb;
  color: #6941c6;
}


.order-status-badge.status-printing {
  background: #fffaeb;
  border: 1px solid #fedf89;
  color: #b54708;
}


.order-status-badge.status-done {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: #067647;
}


.order-card-meta {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(160px, 220px);

  gap: 12px 24px;

  margin-top: 14px !important;
  margin-bottom: 14px !important;

  color: var(--text-soft);

  font-size: 14px;
}


.order-meta-product {
  color: var(--text);

  font-weight: 600;
}


.order-meta-quantity {
  font-weight: 600;
}


.order-card-actions {
  display: flex;

  align-items: center;

  flex-wrap: wrap;

  gap: 8px;

  padding-top: 14px;

  border-top: 1px solid var(--border);
}


.order-card-actions button {
  margin: 0;
}


.order-status-action {
  margin-left: auto !important;

  border-color: var(--primary);

  background: var(--primary);

  color: #ffffff;
}


.order-status-action:hover {
  border-color: var(--primary-hover);

  background: var(--primary-hover);

  color: #ffffff;
}


.order-history {
  margin-top: 14px !important;

  padding: 14px;

  background: var(--surface-soft);

  border: 1px solid var(--border);
  border-radius: 9px;

  color: var(--text-soft);

  font-size: 14px;
}


.order-history > div {
  padding: 5px 0;

  border-bottom: 1px solid var(--border);
}


.order-history > div:last-child {
  border-bottom: 0;
}


@media (max-width: 700px) {

  .order-card-header {
    align-items: flex-start;
    flex-direction: column;
  }


  .order-card-meta {
    grid-template-columns: 1fr;
  }


  .order-status-action {
    margin-left: 0 !important;
  }

}

/* PRODUCT TOOLBAR */
.product-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  align-items: end;
  gap: 14px;

  width: 100%;
  max-width: 900px;
  margin-top: 22px;
  margin-bottom: 20px;
}

.product-toolbar > div {
  margin-bottom: 0;
}

.product-toolbar input,
.product-toolbar select {
  width: 100%;
  max-width: none;
}

.product-toolbar button {
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .product-toolbar {
    grid-template-columns: 1fr;
  }

  .product-toolbar button {
    width: 100%;
  }
}

/* CUSTOMER FORM LAYOUT */
#customerForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;

  width: 100%;
  max-width: 900px;
}

#customerForm > div {
  width: 100%;
  max-width: none;
  margin-bottom: 0;
}

#customerForm > div:nth-child(3) {
  grid-column: 1 / -1;
}

#customerForm input,
#customerForm textarea {
  width: 100%;
  max-width: none;
}

#customerForm > button {
  justify-self: start;
}

@media (max-width: 700px) {
  #customerForm {
    grid-template-columns: 1fr;
  }

  #customerForm > div:nth-child(3) {
    grid-column: auto;
  }
}

/* ORDER FORM LAYOUT */
#orderForm {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) 160px auto;
  align-items: end;
  gap: 14px;

  width: 100%;
  max-width: 1050px;
}

#orderForm > div {
  width: 100%;
  max-width: none;
  margin-bottom: 0;
}

#orderForm input,
#orderForm select {
  width: 100%;
  max-width: none;
}

#orderForm > button {
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 900px) {
  #orderForm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #orderForm {
    grid-template-columns: 1fr;
  }

  #orderForm > button {
    width: 100%;
  }
}

/* CUSTOMER TOOLBAR */
.customer-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  align-items: end;
  gap: 14px;

  width: 100%;
  max-width: 900px;
  margin-top: 22px;
  margin-bottom: 20px;
}

.customer-toolbar > div {
  margin-bottom: 0;
}

.customer-toolbar input,
.customer-toolbar select {
  width: 100%;
  max-width: none;
}

.customer-toolbar button {
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .customer-toolbar {
    grid-template-columns: 1fr;
  }

  .customer-toolbar button {
    width: 100%;
  }
}

/* ORDER TOOLBAR */
.order-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  align-items: end;
  gap: 14px;

  width: 100%;
  max-width: 1050px;
  margin-top: 22px;
  margin-bottom: 20px;
}

.order-toolbar > div {
  margin-bottom: 0;
}

.order-toolbar input,
.order-toolbar select {
  width: 100%;
  max-width: none;
}

.order-toolbar button {
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .order-toolbar {
    grid-template-columns: 1fr;
  }

  .order-toolbar button {
    width: 100%;
  }
}

/* ==============================
   AI CONTENT WORKSPACE
   ============================== */

.ai-workspace {
  display: grid;
  gap: 18px;
}

.ai-panel {
  padding: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.ai-panel-heading {
  margin-bottom: 18px;
}

.ai-panel-heading h3 {
  margin: 0;
}

.ai-panel-heading p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 14px;
}

.ai-compose-grid,
.ai-preset-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.ai-field-wide {
  margin-bottom: 14px;
}

.ai-workspace input,
.ai-workspace select,
.ai-workspace textarea {
  width: 100%;
  max-width: none;
}

.ai-preset-shortcuts {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.ai-preset-shortcuts #aiPresetButtons {
  flex: 1;
}

.ai-output-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.ai-output-actions p {
  margin: 0;
}

.ai-subheading {
  margin-top: 22px !important;
}

.ai-draft-toolbar {
  display: grid;
  grid-template-columns: 180px 220px auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 18px;
}

.ai-draft-toolbar button {
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .ai-compose-grid,
  .ai-preset-form-grid,
  .ai-draft-toolbar {
    grid-template-columns: 1fr;
  }

  .ai-preset-shortcuts,
  .ai-output-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-draft-toolbar button {
    width: 100%;
  }
}

/* ==============================
   PUBLISHING WORKSPACE
   ============================== */

.publishing-workspace {
  display: grid;
  gap: 18px;
}

.publishing-panel {
  padding: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.publishing-panel-heading {
  margin-bottom: 16px;
}

.publishing-panel-heading h3 {
  margin: 0;
}

.publishing-panel-heading p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 14px;
}

.publishing-control-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.publishing-control-row button {
  margin: 0;
}

.publishing-control-row #refreshPublishingButton {
  margin-left: auto;
}

#facebookConnectionResult {
  color: var(--text-soft);
  font-size: 14px;
}

#publishingOverview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

#publishingOverview > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

#publishingOverview > div span {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.publishing-alert-panel {
  border-color: #fedf89;
  background: #fffcf5;
}

#publishingAlertList,
#publishingApprovedList,
#publishingJobList {
  margin-top: 0;
}

.publishing-detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.publishing-detail-heading h3 {
  margin: 0;
}

.publishing-detail-heading button {
  margin: 0;
}

@media (max-width: 900px) {
  #publishingOverview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .publishing-control-row {
    align-items: stretch;
    flex-direction: column;
  }

  .publishing-control-row #refreshPublishingButton {
    margin-left: 0;
  }

  #publishingOverview {
    grid-template-columns: 1fr;
  }

  .publishing-detail-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

/* ==============================
   PUBLISHING SCROLL AREAS
   ============================== */

#publishingAlertList,
#publishingApprovedList,
#publishingJobList {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 6px;
}

#publishingAlertList {
  max-height: 320px;
}

#publishingApprovedList {
  max-height: 360px;
}

#publishingJobList {
  max-height: 520px;
}

@media (max-width: 700px) {
  #publishingAlertList {
    max-height: 280px;
  }

  #publishingApprovedList {
    max-height: 320px;
  }

  #publishingJobList {
    max-height: 420px;
  }
}

/* ==============================
   AUTH LOGOUT HEADER
   ============================== */

.hana-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: 24px;
}

.hana-header-actions .hana-header-user {
  margin-left: 0;
}

.hana-logout-button {
  min-height: 34px;
  margin: 0;
  padding: 7px 11px;
  font-size: 13px;
}

.hana-logout-status {
  flex-basis: 100%;
  min-height: 0;
  color: var(--danger);
  font-size: 12px;
  text-align: right;
}

@media (max-width: 700px) {
  .hana-header-actions {
    justify-content: flex-start;
    width: 100%;
    margin-left: 0;
  }

  .hana-logout-status {
    text-align: left;
  }
}

/* ==============================
   HANA FEEDBACK STATES
   ============================== */

.hana-feedback {
  min-height: 20px;
  margin: 10px 0;
  font-size: 14px;
}

.hana-feedback.is-loading {
  color: var(--text-soft);
}

.hana-feedback.is-success {
  color: #067647;
  font-weight: 600;
}

.hana-feedback.is-error {
  color: var(--danger);
  font-weight: 600;
}

.hana-empty-state {
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 14px;
  text-align: center;
}

.hana-action-loading {
  opacity: 0.7;
  cursor: wait;
}


/* CUSTOMER BULK ACTIONS */
.customer-bulk-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;

  margin: 0 0 18px;
  padding: 12px 14px;

  background: var(--surface-soft);

  border: 1px solid var(--border);
  border-radius: 10px;
}

.customer-bulk-select-all {
  display: flex;
  align-items: center;
  gap: 8px;

  margin: 0 8px 0 0;

  cursor: pointer;
}

.customer-bulk-select-all input,
.customer-select-checkbox {
  width: auto;
  max-width: none;

  margin: 0;

  accent-color: var(--primary);
}

.customer-bulk-bar strong {
  margin-right: auto;

  color: var(--text-soft);

  font-size: 13px;
}

.customer-bulk-bar button {
  margin: 0;
}

.customer-select-checkbox {
  flex: 0 0 auto;
}

@media (max-width: 700px) {
  .customer-bulk-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-bulk-bar strong {
    margin-right: 0;
  }

  .customer-bulk-bar button {
    width: 100%;
  }
}



/* ==============================
   ORDER UX - SESSION 170
   ============================== */

/* Header g?n h?n ?? nh??ng di?n t?ch cho n?i dung */
.hana-page-header {
  min-height: 68px;
  padding: 8px 18px;
}

.hana-page-eyebrow {
  display: none;
}

.hana-page-header h2 {
  margin: 2px 0;
  font-size: 21px;
}

.hana-page-header p {
  margin: 0;
  font-size: 12px;
}

.hana-header-actions {
  gap: 6px;
}

.hana-header-user {
  padding: 5px 8px;
  font-size: 12px;
}

.hana-logout-button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}


/* S?n ph?m v? s? l??ng n?m g?n nhau */
.order-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 8px 12px;

  margin-top: 12px !important;
  margin-bottom: 12px !important;
}

.order-meta-product {
  min-width: 0;

  color: var(--text);

  font-weight: 600;

  overflow-wrap: anywhere;
}

.order-meta-quantity {
  flex: 0 0 auto;

  padding: 5px 9px;

  background: var(--surface-soft);

  border: 1px solid var(--border);
  border-radius: 7px;

  color: var(--text);

  font-weight: 700;

  white-space: nowrap;
}


/* Desktop: gi? c?ng c? t?m/l?c khi cu?n danh s?ch */
@media (min-width: 901px) {

  .order-toolbar {
    position: sticky;
    top: 68px;
    z-index: 15;

    padding: 10px 0;

    background: var(--surface);

    border-bottom: 1px solid var(--border);

    box-shadow:
      0 5px 10px rgba(15, 23, 42, 0.04);
  }

}


/* Mobile kh?ng gi? toolbar ?? tr?nh chi?m m?n h?nh */
@media (max-width: 700px) {

  .hana-page-header {
    min-height: auto;
    padding: 10px 14px;
  }

  .order-meta-product {
    width: 100%;
  }

}



/* ==============================
   CUSTOMER UX - SESSION 170
   ============================== */

#customerNote {
  height: 64px;
  min-height: 58px;

  resize: vertical;
}


@media (min-width: 901px) {

  .customer-toolbar {
    position: sticky;
    top: 68px;
    z-index: 15;

    padding: 10px 0;

    background: var(--surface);

    border-bottom: 1px solid var(--border);

    box-shadow:
      0 5px 10px rgba(15, 23, 42, 0.04);
  }

}



/* ==============================
   CUSTOMER UX POLISH 170
   ============================== */

/* Vietnamese status badge: avoid odd accent spacing */
.customer-status-badge {
  font-family: inherit;
  letter-spacing: 0;
}


/* Search/filter + bulk = one sticky control area */
.customer-sticky-tools {
  margin-bottom: 18px;
}


@media (min-width: 901px) {

  .customer-sticky-tools {
    position: sticky;
    top: 68px;
    z-index: 15;

    padding: 10px 0;

    background: var(--surface);

    border-bottom: 1px solid var(--border);

    box-shadow:
      0 5px 10px rgba(15, 23, 42, 0.04);
  }


  .customer-sticky-tools .customer-toolbar {
    position: static;

    margin-top: 0;
    margin-bottom: 10px;

    padding: 0;

    background: transparent;

    border-bottom: 0;

    box-shadow: none;
  }


  .customer-sticky-tools .customer-bulk-bar {
    position: static;

    margin: 0;
    padding: 9px 11px;

    box-shadow: none;
  }

}


@media (max-width: 900px) {

  .customer-sticky-tools {
    position: static;
  }

}



/* ==============================
   CUSTOMER STATUS TYPOGRAPHY FIX 170
   ============================== */

.customer-status-badge {
  font-family:
    "Segoe UI",
    Arial,
    sans-serif;

  font-size: 12px;
  font-weight: 700;

  line-height: 1.25;
  letter-spacing: 0;

  padding: 6px 10px;
}



/* ==============================
   HANA HIDDEN ELEMENT FIX 170
   ============================== */

[hidden] {
  display: none !important;
}



/* ==============================
   PRODUCT UX - SESSION 170
   ============================== */

.product-sticky-tools {
  margin-bottom: 18px;
}

.product-list-summary {
  margin: 0;

  color: var(--text-soft);

  font-size: 13px;
  font-weight: 600;
}


/* Price must be easy to scan */
.product-card-price {
  display: inline-flex;

  width: fit-content;

  margin-top: 12px !important;
  margin-bottom: 14px !important;

  padding: 6px 10px;

  background: var(--surface-soft);

  border: 1px solid var(--border);
  border-radius: 7px;

  color: var(--text);

  font-size: 15px;
  font-weight: 700;
}


@media (min-width: 901px) {

  .product-sticky-tools {
    position: sticky;
    top: 68px;
    z-index: 15;

    padding: 10px 0;

    background: var(--surface);

    border-bottom: 1px solid var(--border);

    box-shadow:
      0 5px 10px rgba(15, 23, 42, 0.04);
  }


  .product-sticky-tools .product-toolbar {
    position: static;

    margin-top: 0;
    margin-bottom: 6px;

    padding: 0;

    background: transparent;

    border-bottom: 0;

    box-shadow: none;
  }

}


@media (max-width: 900px) {

  .product-sticky-tools {
    position: static;
  }

}



/* ==============================
   PRODUCT STATUS TYPOGRAPHY FIX 170
   ============================== */

.product-status-badge {
  font-family:
    "Segoe UI",
    Arial,
    sans-serif;

  font-size: 12px;
  font-weight: 700;

  line-height: 1.25;
  letter-spacing: 0;

  padding: 6px 10px;
}



/* ==============================
   AI PRESET SCROLL UX 170
   ============================== */

#aiPresetManageList {
  max-height: 280px;

  overflow-y: auto;
  overscroll-behavior: contain;

  scrollbar-gutter: stable;

  padding-right: 6px;
}


@media (max-width: 700px) {

  #aiPresetManageList {
    max-height: 240px;
  }

}



/* ==============================
   PUBLISHING JOB CARDS 170
   ============================== */

#publishingJobList {
  display: grid;
  gap: 10px;
}


.publishing-job-card {
  display: flex;

  align-items: center;
  flex-wrap: wrap;

  gap: 10px;

  padding: 14px 16px;

  background: #ffffff;

  border: 1px solid var(--border);
  border-radius: 10px;

  box-shadow:
    0 1px 3px rgba(15, 23, 42, 0.04);
}


.publishing-job-card-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  width: 100%;

  gap: 12px;
}


.publishing-job-card-title {
  color: var(--text);

  font-size: 16px;
  font-weight: 700;
}


.publishing-job-header-actions {
  display: flex;

  align-items: center;

  gap: 8px;
}


.publishing-job-card-meta {
  display: flex;

  flex-basis: 100%;
  flex-wrap: wrap;

  gap: 6px 14px;

  color: var(--text-soft);

  font-size: 13px;
}


.publishing-job-card-meta span:not(:last-child)::after {
  content: "?";

  margin-left: 14px;

  color: var(--border-strong);
}


/* STATUS */

.publishing-job-status {
  padding: 5px 9px;

  border-radius: 999px;

  font-family:
    "Segoe UI",
    Arial,
    sans-serif;

  font-size: 12px;
  font-weight: 700;

  line-height: 1.25;
  letter-spacing: 0;

  white-space: nowrap;
}


.publishing-job-status.status-ready {
  background: #eff8ff;
  border: 1px solid #b2ddff;
  color: #175cd3;
}


.publishing-job-status.status-scheduled {
  background: #f9f5ff;
  border: 1px solid #d6bbfb;
  color: #6941c6;
}


.publishing-job-status.status-publishing {
  background: #fffaeb;
  border: 1px solid #fedf89;
  color: #b54708;
}


.publishing-job-status.status-published {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: #067647;
}


.publishing-job-status.status-failed {
  background: #fef3f2;
  border: 1px solid #fecdca;
  color: #b42318;
}


/* BUTTONS */

.publishing-job-card button {
  margin: 0;
}


.publishing-job-detail-button {
  min-height: 32px;

  padding: 5px 9px;

  font-size: 12px;
}


.publishing-job-action-primary {
  border-color: var(--primary);

  background: var(--primary);

  color: #ffffff;
}


.publishing-job-action-success {
  border-color: #abefc6;

  background: #ecfdf3;

  color: #067647;
}


.publishing-job-action-warning {
  border-color: #fedf89;

  background: #fffaeb;

  color: #b54708;
}


.publishing-job-action-secondary {
  background: #ffffff;
}


/* INFO BELOW MAIN HEADER */

.publishing-job-card >
span {
  flex-basis: 100%;

  color: var(--text-soft);

  font-size: 13px;
}


.publishing-job-card >
div:not(.publishing-job-card-header):not(.publishing-job-card-meta) {
  flex-basis: 100%;

  padding: 7px 9px;

  background: var(--surface-soft);

  border-radius: 7px;

  color: var(--text-soft);

  font-size: 13px;
}


.publishing-job-card >
input[type="datetime-local"] {
  width: auto;
  min-width: 210px;

  margin: 0;
}


@media (max-width: 700px) {

  .publishing-job-card-header {
    align-items: flex-start;
    flex-direction: column;
  }


  .publishing-job-header-actions {
    justify-content:
      space-between;

    width: 100%;
  }


  .publishing-job-card >
  input[type="datetime-local"] {
    width: 100%;
  }


  .publishing-job-card >
  button {
    width: 100%;
  }

}



/* ==============================
   PUBLISHING OVERVIEW COMPACT 170
   ============================== */

/*
  Daily work first.
  Monitoring information stays below.
*/

.publishing-overview-panel {
  order: 4;

  padding: 12px 14px;
}


.publishing-alert-panel {
  order: 5;
}


/* Compact heading */

.publishing-overview-panel
.publishing-panel-heading {
  display: flex;

  align-items: baseline;
  flex-wrap: wrap;

  gap: 4px 10px;

  margin-bottom: 8px;
}


.publishing-overview-panel
.publishing-panel-heading h3 {
  font-size: 14px;
  font-weight: 700;
}


.publishing-overview-panel
.publishing-panel-heading p {
  margin: 0;

  font-size: 12px;
}


/* Compact overview */

#publishingOverview {
  grid-template-columns:
    repeat(6, minmax(0, 1fr));

  gap: 6px;
}


#publishingOverview > div {
  min-height: 38px;

  padding: 7px 9px;

  gap: 6px;

  border-radius: 7px;

  box-shadow: none;
}


#publishingOverview > div strong {
  color: var(--text-soft);

  font-size: 12px;
  font-weight: 600;
}


#publishingOverview > div span {
  color: var(--text);

  font-size: 16px;
  font-weight: 700;
}


@media (max-width: 1100px) {

  #publishingOverview {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

}


@media (max-width: 700px) {

  #publishingOverview {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

}



/* ==============================
   PUBLISHING CONTROL COMPACT 170
   ============================== */

/*
  Connection is a utility bar,
  not a primary work panel.
*/

.publishing-control-panel {
  padding: 10px 14px;
}


.publishing-control-panel
.publishing-panel-heading {
  display: flex;

  align-items: baseline;

  gap: 8px;

  margin-bottom: 7px;
}


.publishing-control-panel
.publishing-panel-heading h3 {
  margin: 0;

  font-size: 14px;
}


.publishing-control-panel
.publishing-panel-heading p {
  display: none;
}


.publishing-control-row {
  gap: 7px;
}


.publishing-control-row button {
  min-height: 30px;

  padding: 5px 9px;

  font-size: 12px;
}


#facebookConnectionResult {
  font-size: 12px;
}


#publishingResult {
  min-height: 0;

  margin: 5px 0 0;

  font-size: 12px;
}


/* Job recognition */

.publishing-job-content-preview {
  flex-basis: 100%;

  overflow: hidden;

  color: var(--text-soft);

  font-size: 13px;
  line-height: 1.45;

  text-overflow: ellipsis;

  white-space: nowrap;
}


.publishing-job-card-title {
  font-size: 15px;
}


@media (max-width: 700px) {

  .publishing-control-panel
  .publishing-panel-heading {
    display: block;
  }


  .publishing-job-content-preview {
    white-space: normal;
  }

}



/* ==============================
   PUBLISHING APPROVED TRANSFER STATE 170
   ============================== */

#publishingApprovedList {
  display: grid;
  gap: 8px;
}


.publishing-approved-item {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto;

  align-items: center;

  gap: 12px;

  padding: 10px 12px;

  background: #ffffff;

  border: 1px solid var(--border);
  border-radius: 8px;
}


.publishing-approved-main {
  display: grid;
  gap: 3px;

  min-width: 0;
}


.publishing-approved-main strong {
  color: var(--text);

  font-size: 14px;
}


.publishing-approved-main span {
  color: var(--text-soft);

  font-size: 12px;
}


.publishing-approved-actions {
  display: flex;

  align-items: center;
  flex-wrap: wrap;

  justify-content: flex-end;

  gap: 8px;
}


.publishing-approved-actions button {
  margin: 0;
}


.publishing-approved-item.is-transferred {
  background: #f6fef9;

  border-color: #abefc6;
}


.publishing-transfer-status {
  padding: 5px 8px;

  background: #ecfdf3;

  border-radius: 999px;

  color: #067647;

  font-family:
    "Segoe UI",
    Arial,
    sans-serif;

  font-size: 12px;
  font-weight: 700;

  white-space: nowrap;
}


.publishing-transfer-done {
  border-color: #abefc6;

  background: #ecfdf3;

  color: #067647;

  font-size: 12px;
  font-weight: 700;

  cursor: default;
}


@media (max-width: 700px) {

  .publishing-approved-item {
    grid-template-columns: 1fr;
  }


  .publishing-approved-actions {
    justify-content: flex-start;
  }

}



/* ==============================
   AI ONE ACTION FLOW 170
   ============================== */

.ai-output-actions {
  align-items: center;
  flex-wrap: wrap;
}


.ai-output-actions > button {
  margin: 0;
}


.ai-publish-primary,
.ai-draft-publish-button {
  border-color: var(--primary);

  background: var(--primary);

  color: #ffffff;
}


.ai-schedule-control {
  display: flex;

  align-items: center;

  gap: 8px;
}


.ai-schedule-control
input[type="datetime-local"] {
  width: 205px;

  margin: 0;
}


.ai-schedule-control button {
  margin: 0;
}


#aiDraftResult {
  flex-basis: 100%;

  margin: 4px 0 0;
}


#aiDraftList {
  display: grid;

  gap: 10px;
}


.ai-draft-card {
  padding: 12px 14px;

  background: #ffffff;

  border: 1px solid var(--border);
  border-radius: 9px;
}


.ai-draft-card-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 10px;
}


.ai-draft-card-header strong {
  font-size: 14px;
}


.ai-draft-status {
  padding: 4px 8px;

  background: var(--surface-soft);

  border: 1px solid var(--border);
  border-radius: 999px;

  color: var(--text-soft);

  font-family:
    "Segoe UI",
    Arial,
    sans-serif;

  font-size: 12px;
  font-weight: 600;

  letter-spacing: 0;
}


.ai-draft-meta {
  margin-top: 4px;

  color: var(--text-soft);

  font-size: 12px;
}


.ai-draft-preview {
  margin-top: 8px;

  color: var(--text);

  font-size: 13px;
  line-height: 1.45;
}


.ai-draft-actions {
  display: flex;

  align-items: center;
  flex-wrap: wrap;

  gap: 8px;

  margin-top: 10px;

  padding-top: 10px;

  border-top: 1px solid var(--border);
}


.ai-draft-actions button {
  margin: 0;
}


.ai-draft-schedule-input {
  width: 205px !important;

  margin: 0 !important;
}


.ai-draft-channel-note {
  color: var(--text-soft);

  font-size: 12px;
}


@media (max-width: 700px) {

  .ai-output-actions,
  .ai-schedule-control,
  .ai-draft-actions {
    align-items: stretch;

    flex-direction: column;
  }


  .ai-schedule-control
  input[type="datetime-local"],
  .ai-draft-schedule-input {
    width: 100% !important;
  }


  .ai-output-actions > button,
  .ai-schedule-control button,
  .ai-draft-actions button {
    width: 100%;
  }

}



/* ==============================
   AI PUBLISHING STATUS SYNC 170
   ============================== */

.ai-current-publishing-status {
  display: inline-flex;

  align-items: center;

  min-height: 30px;

  padding: 5px 9px;

  border: 1px solid var(--border);
  border-radius: 999px;

  background: var(--surface-soft);

  color: var(--text-soft);

  font-family:
    "Segoe UI",
    Arial,
    sans-serif;

  font-size: 12px;
  font-weight: 700;

  letter-spacing: 0;
}


.ai-current-publishing-status[hidden] {
  display: none;
}


.ai-draft-job-state {
  display: inline-flex;

  align-items: center;

  padding: 5px 9px;

  border-radius: 999px;

  font-family:
    "Segoe UI",
    Arial,
    sans-serif;

  font-size: 12px;
  font-weight: 700;

  letter-spacing: 0;
}


.ai-draft-status.status-ready,
.ai-current-publishing-status.status-ready,
.ai-draft-job-state.status-ready {
  background: #eff8ff;

  border-color: #b2ddff;

  color: #175cd3;
}


.ai-draft-status.status-scheduled,
.ai-current-publishing-status.status-scheduled,
.ai-draft-job-state.status-scheduled {
  background: #f9f5ff;

  border-color: #d6bbfb;

  color: #6941c6;
}


.ai-draft-status.status-publishing,
.ai-current-publishing-status.status-publishing,
.ai-draft-job-state.status-publishing {
  background: #fffaeb;

  border-color: #fedf89;

  color: #b54708;
}


.ai-draft-status.status-published,
.ai-current-publishing-status.status-published,
.ai-draft-job-state.status-published {
  background: #ecfdf3;

  border-color: #abefc6;

  color: #067647;
}


.ai-draft-status.status-failed,
.ai-current-publishing-status.status-failed,
.ai-draft-job-state.status-failed {
  background: #fef3f2;

  border-color: #fecdca;

  color: #b42318;
}



/* ==============================
   PUBLISHING ALERT AND DRAWER UX 170
   ============================== */

.publishing-alert-panel[hidden] {
  display: none !important;
}


.publishing-alert-panel.has-alerts {
  order: 0;

  padding: 11px 13px;

  background: #fffcf5;

  border-color: #fedf89;
}


.publishing-alert-panel.has-alerts
.publishing-panel-heading {
  display: flex;

  align-items: baseline;
  flex-wrap: wrap;

  gap: 4px 10px;

  margin-bottom: 8px;
}


.publishing-alert-panel.has-alerts
.publishing-panel-heading h3 {
  margin: 0;

  color: #b54708;

  font-size: 14px;
  font-weight: 700;
}


.publishing-alert-panel.has-alerts
.publishing-panel-heading p {
  margin: 0;

  font-size: 12px;
}


#publishingAlertList {
  display: grid;

  gap: 7px;
}


#publishingAlertList > div {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 10px;

  padding: 8px 10px;

  background: #ffffff;

  border: 1px solid #fedf89;
  border-radius: 7px;

  font-size: 13px;
}


#publishingAlertList > div button {
  flex: 0 0 auto;

  min-height: 30px;

  margin: 0;

  padding: 5px 9px;

  font-size: 12px;
}


/* DETAIL DRAWER */

#publishingJobDetail {
  position: fixed;

  top: 82px;
  right: 22px;
  bottom: 22px;

  z-index: 70;

  width:
    min(
      520px,
      calc(100vw - 44px)
    );

  margin: 0;

  padding: 18px;

  overflow-y: auto;
  overscroll-behavior: contain;

  background: #ffffff;

  border:
    1px solid var(--border-strong);

  border-radius: 12px;

  box-shadow:
    0 18px 48px
    rgba(15, 23, 42, 0.22);
}


#publishingJobDetail
.publishing-detail-heading {
  position: sticky;

  top: -18px;

  z-index: 2;

  margin:
    -18px
    -18px
    14px;

  padding: 14px 18px;

  background: #ffffff;

  border-bottom:
    1px solid var(--border);
}


#publishingJobDetailContent > div {
  padding: 9px 0;

  border-bottom:
    1px solid var(--border);

  color: var(--text-soft);

  font-size: 13px;
  line-height: 1.45;
}


#publishingJobDetailContent > div:last-child {
  border-bottom: 0;
}


#publishingJobDetailContent strong {
  color: var(--text);
}


@media (max-width: 700px) {

  #publishingAlertList > div {
    align-items: stretch;

    flex-direction: column;
  }


  #publishingAlertList > div button {
    width: 100%;
  }


  #publishingJobDetail {
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;

    width: auto;

    padding: 16px;
  }


  #publishingJobDetail
  .publishing-detail-heading {
    top: -16px;

    margin:
      -16px
      -16px
      14px;

    padding: 12px 16px;
  }

}

/* ==============================
   PRODUCT CATALOGUE EDITOR
   ============================== */

.product-catalogue-summary {
  display: grid;

  gap: 7px;

  margin:
    0 0 14px !important;

  padding:
    12px 14px;

  background:
    var(--surface-soft);

  border:
    1px solid var(--border);

  border-radius:
    9px;
}


.product-catalogue-meta {
  display: flex;

  align-items: center;

  flex-wrap: wrap;

  gap: 8px 18px;

  color:
    var(--text-soft);

  font-size:
    13px;
}


.product-catalogue-meta strong {
  color:
    var(--text);
}


.product-catalogue-summary p {
  margin:
    0;

  color:
    var(--text-soft);

  font-size:
    13px;

  line-height:
    1.55;
}


.product-catalogue-editor {
  margin:
    0 0 14px !important;

  padding:
    14px;

  background:
    #ffffff;

  border:
    1px solid var(--border-strong);

  border-radius:
    10px;
}


.product-catalogue-editor-grid {
  display: grid;

  grid-template-columns:
    minmax(180px, 0.65fr)
    minmax(0, 1.35fr);

  gap:
    12px 16px;
}


.product-catalogue-editor-grid > div {
  margin:
    0;
}


.product-catalogue-editor input,
.product-catalogue-editor textarea {
  width:
    100%;

  max-width:
    none;
}


.product-catalogue-editor textarea {
  min-height:
    86px;
}


.product-catalogue-editor-image {
  grid-column:
    1 / -1;
}


.product-catalogue-editor-actions {
  display: flex;

  gap: 8px;

  margin-top:
    14px;
}


.product-catalogue-editor-actions button {
  margin:
    0;
}


@media (max-width: 700px) {

  .product-catalogue-editor-grid {
    grid-template-columns:
      1fr;
  }


  .product-catalogue-editor-image {
    grid-column:
      auto;
  }

}


.product-catalogue-inline-feedback {
  min-height: 20px;

  margin-top: 10px;

  font-size: 13px;

  font-weight: 700;
}


.product-catalogue-inline-feedback.is-loading {
  color: var(--text-soft);
}


.product-catalogue-inline-feedback.is-success {
  color: #067647;
}


.product-catalogue-inline-feedback.is-error {
  color: #b42318;
}


/* ==============================
   QUOTE REQUEST ADMIN UI
   ============================== */

.quote-request-heading {
  display:
    flex;

  align-items:
    flex-start;

  justify-content:
    space-between;

  gap:
    18px;

  margin-bottom:
    16px;
}


.quote-request-heading h2 {
  margin:
    0 0 4px;
}


.quote-request-heading p {
  margin:
    0;

  color:
    var(--text-soft);

  font-size:
    14px;
}


.quote-request-heading button {
  flex:
    0 0 auto;

  margin:
    0;
}


.quote-request-list {
  display:
    grid;

  gap:
    14px;
}


.quote-request-card {
  padding:
    18px;

  background:
    var(--surface-soft);

  border:
    1px solid
    var(--border);

  border-radius:
    12px;
}


.quote-request-card-header {
  display:
    flex;

  align-items:
    flex-start;

  justify-content:
    space-between;

  gap:
    14px;

  margin-bottom:
    14px;
}


.quote-request-card-header h3 {
  margin:
    0;

  font-size:
    17px;
}


.quote-request-card-header p {
  margin:
    4px 0 0;

  color:
    var(--text-soft);

  font-size:
    13px;
}


.quote-request-status-badge {
  flex:
    0 0 auto;

  padding:
    5px 9px;

  background:
    #ecfdf3;

  border:
    1px solid
    #abefc6;

  border-radius:
    999px;

  color:
    #067647;

  font-size:
    12px;

  font-weight:
    700;
}


.quote-request-block {
  margin-top:
    12px;
}


.quote-request-block strong {
  display:
    block;

  margin-bottom:
    5px;

  font-size:
    13px;
}


.quote-request-block p,
.quote-request-block ul {
  margin:
    0;

  color:
    var(--text-soft);

  font-size:
    14px;
}


.quote-request-block ul {
  padding-left:
    20px;
}


@media (max-width: 700px) {

  .quote-request-heading,
  .quote-request-card-header {
    align-items:
      stretch;

    flex-direction:
      column;
  }


  .quote-request-heading button {
    width:
      100%;
  }


  .quote-request-status-badge {
    align-self:
      flex-start;
  }

}
