:root {
  --admin-blue: #0143ad;
  --admin-dark: #071f3e;
  --admin-green: #6e9d02;
  --admin-bg: #f3f6fa;
  --admin-border: #e3e7ed;
  --admin-muted: #748094;
}
* { box-sizing: border-box; }
body { margin: 0; overflow-x: hidden; color: #1d2b3e; font-family: Arial, Helvetica, sans-serif; font-size: 14px; }
a, a:hover { text-decoration: none; }
.btn-primary { border-color: var(--admin-blue); background: var(--admin-blue); }
.btn-primary:hover { border-color: #062f6d; background: #062f6d; }
.btn-success { border-color: var(--admin-green); background: var(--admin-green); }
.admin-body { min-height: 100vh; background: var(--admin-bg); }
.admin-topbar {
  position: fixed;
  z-index: 1050;
  top: 0;
  right: 0;
  left: 0;
  height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--admin-dark);
}
.admin-brand-wrap, .admin-brand { display: flex; align-items: center; }
.admin-brand { gap: 12px; color: #fff; font-weight: 700; }
.admin-brand:hover { color: #fff; }
.admin-brand img { width: 58px; height: 48px; padding: 3px; object-fit: contain; border-radius: 8px; background: #fff; }
.admin-brand span, .admin-brand span small { display: block; }
.admin-brand span b { font-size: 16px; }
.admin-brand span small { margin-top: 2px; color: #a9bad0; font-size: 11px; font-weight: 500; }
.admin-menu-toggle { width: 40px; height: 40px; margin-right: 10px; display: none; border: 0; border-radius: 8px; color: #fff; background: rgba(255,255,255,.1); font-size: 18px; }
.admin-user { display: flex; align-items: center; gap: 15px; color: #fff; }
.admin-user form { margin: 0; }
.admin-layout { display: flex; padding-top: 72px; }
.admin-sidebar {
  position: fixed;
  top: 72px;
  bottom: 0;
  left: 0;
  width: 250px;
  padding: 22px 16px;
  overflow-y: auto;
  border-right: 1px solid var(--admin-border);
  background: #fff;
}
.admin-nav-label { padding: 0 13px 10px; color: #9aa4b3; font-size: 10px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
.admin-sidebar a {
  margin-bottom: 7px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  color: #536075;
  font-weight: 700;
}
.admin-sidebar a i { width: 22px; font-size: 18px; }
.admin-sidebar a:hover { color: var(--admin-blue); background: #edf4ff; }
.admin-sidebar a.active { color: #fff; background: linear-gradient(135deg, var(--admin-blue), #2476e8); box-shadow: 0 8px 20px rgba(1,67,173,.2); }
.admin-sidebar-backdrop { display: none; }
.admin-content { width: calc(100% - 250px); min-width: 0; min-height: calc(100vh - 72px); margin-left: 250px; padding: 30px clamp(18px, 2.2vw, 38px); }
.admin-page-heading { margin-bottom: 25px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-page-heading small { color: var(--admin-green); font-weight: 800; text-transform: uppercase; letter-spacing: .8px; }
.admin-page-heading h1 { margin: 3px 0 0; font-size: 28px; font-weight: 800; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-card, .stat-card, .workflow-card {
  overflow: hidden;
  border: 1px solid var(--admin-border);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 5px 22px rgba(18,43,74,.05);
}
.dashboard-stats { margin-bottom: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat-card { min-width: 0; min-height: 112px; padding: 18px; display: flex; align-items: center; gap: 14px; }
.stat-copy { min-width: 0; }
.stat-icon { width: 52px; height: 52px; flex: 0 0 52px; display: flex; align-items: center; justify-content: center; border-radius: 12px; font-size: 23px; }
.stat-icon.blue { color: #1768c4; background: #e5f1ff; }
.stat-icon.green { color: #5d8500; background: #eef7d8; }
.stat-icon.orange { color: #c87312; background: #fff0dc; }
.stat-icon.purple { color: #764bc4; background: #eee7fc; }
.stat-card small, .stat-card strong { display: block; }
.stat-card small { overflow: hidden; color: var(--admin-muted); text-overflow: ellipsis; white-space: nowrap; }
.stat-card strong { margin-top: 4px; overflow: hidden; font-size: clamp(20px, 1.8vw, 26px); text-overflow: ellipsis; white-space: nowrap; }
.stat-card .stat-money { font-size: clamp(17px, 1.5vw, 23px); }
.admin-card-header { min-height: 65px; padding: 15px 19px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--admin-border); }
.admin-card-header h2, .form-title { margin: 0; font-size: 18px; font-weight: 800; }
.admin-table th { padding: 13px 15px; border: 0; color: var(--admin-muted); background: #f8f9fb; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.admin-table td { padding: 14px 15px; border-top: 1px solid #eef0f3; vertical-align: middle; }
.entity-cell { min-width: 240px; display: flex; align-items: center; gap: 13px; }
.entity-cell img { width: 62px; height: 62px; padding: 4px; object-fit: contain; border-radius: 7px; background: #f5f7fa; }
.entity-cell strong, .entity-cell small { display: block; }
.entity-cell small { margin-top: 4px; color: var(--admin-muted); }
.status-badge { padding: 5px 9px; display: inline-block; border-radius: 20px; font-size: 10px; font-weight: 800; text-transform: capitalize; }
.status-active, .status-delivered { color: #176b3e; background: #def5e8; }
.status-inactive, .status-cancelled { color: #ad2b39; background: #ffe2e5; }
.status-pending { color: #a96409; background: #fff0d5; }
.status-confirmed { color: #1768aa; background: #e2f1ff; }
.status-shipped { color: #6748b8; background: #eee8ff; }
.admin-search { display: flex; gap: 6px; }
.admin-search .form-control { width: 270px; }
.form-control { min-height: 44px; border-color: #d9dee5; border-radius: 6px; }
textarea.form-control { min-height: auto; }
.product-description-textarea { height: 190px; min-height: 120px !important; max-height: 650px; overflow-y: auto; resize: vertical; white-space: pre-wrap; line-height: 1.7; }
.rich-editor { overflow: hidden; border: 1px solid #cfd6df; border-radius: 7px; background: #fff; }
.rich-editor:focus-within { border-color: #80aee9; box-shadow: 0 0 0 3px rgba(1,67,173,.1); }
.rich-editor-toolbar { min-height: 48px; padding: 7px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; border-bottom: 1px solid #dfe4ea; background: #f7f8fa; }
.rich-editor-toolbar button, .rich-editor-format { height: 34px; min-width: 34px; border: 1px solid transparent; border-radius: 4px; color: #26364a; background: transparent; }
.rich-editor-toolbar button:hover, .rich-editor-toolbar button:focus, .rich-editor-format:hover { border-color: #cbd3dd; color: var(--admin-blue); background: #fff; }
.rich-editor-format { min-width: 125px; padding: 0 9px; border-color: #d5dbe3; background: #fff; }
.rich-editor-content { height: 290px; min-height: 180px; max-height: 650px; padding: 18px; overflow-y: auto; outline: 0; resize: vertical; color: #17263a; font-size: 15px; line-height: 1.7; }
.rich-editor-content:empty::before { content: 'Write complete product description here...'; color: #9aa4b3; pointer-events: none; }
.rich-editor-content p { margin: 0 0 16px; }
.rich-editor-content h2, .rich-editor-content h3, .rich-editor-content h4 { margin: 20px 0 10px; font-weight: 800; }
.rich-editor-content h2 { font-size: 25px; }
.rich-editor-content h3 { font-size: 21px; }
.rich-editor-content h4 { font-size: 18px; }
.rich-editor-content ul, .rich-editor-content ol { margin: 0 0 16px; padding-left: 28px; }
.rich-editor-content blockquote { margin: 16px 0; padding: 10px 15px; border-left: 4px solid var(--admin-blue); background: #f3f7fc; }
.rich-editor-value { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.ck.ck-editor { width: 100%; }
.ck.ck-toolbar { border-color: #cfd6df; border-radius: 7px 7px 0 0; background: #f7f8fa; }
.ck.ck-editor__main > .ck-editor__editable { border-color: #cfd6df; border-radius: 0 0 7px 7px; }
.ck-editor__editable_inline { min-height: 360px; max-height: 680px; overflow-y: auto; color: #17263a; font-size: 15px; line-height: 1.7; }
.ck-content p { min-height: 1em; margin: 0 0 16px; white-space: pre-wrap; }
.ck-content h1, .ck-content h2, .ck-content h3, .ck-content h4, .ck-content h5, .ck-content h6 { margin: 20px 0 10px; font-weight: 800; line-height: 1.3; }
.ck-content h1 { font-size: 30px; }
.ck-content h2 { font-size: 26px; }
.ck-content h3 { font-size: 22px; }
.ck-content h4 { font-size: 19px; }
.ck-content h5 { font-size: 17px; }
.ck-content h6 { font-size: 15px; text-transform: uppercase; letter-spacing: .03em; }
.ck-content blockquote { border-left-color: var(--admin-blue); }
.ck-content figure.table { margin: 22px 0; overflow-x: auto; }
.ck-content table { width: 100%; border-collapse: collapse; }
.ck-content th, .ck-content td { min-width: 90px; padding: 9px 11px; border: 1px solid #ccd4df; }
.ck-content figure.image img { max-width: 100%; height: auto; }
.ck-content figcaption { color: #637083; font-size: 13px; text-align: center; }
.advanced-editor-shell { position: relative; border-radius: 7px; background: #fff; }
.advanced-editor-actions { padding: 7px 9px; display: flex; justify-content: flex-end; gap: 7px; border: 1px solid #cfd6df; border-bottom: 0; border-radius: 7px 7px 0 0; background: #eef2f7; }
.advanced-editor-action { min-height: 32px; padding: 5px 10px; border: 1px solid #c6ced9; border-radius: 5px; color: #26364a; background: #fff; font-size: 13px; font-weight: 700; }
.advanced-editor-action:hover, .advanced-editor-action:focus { color: var(--admin-blue); border-color: #91add0; }
.advanced-editor-shell .ck.ck-toolbar { border-radius: 0; }
.advanced-editor-source { width: 100%; min-height: 420px !important; max-height: 680px; padding: 18px; overflow: auto; resize: vertical; border: 1px solid #cfd6df; border-radius: 0 0 7px 7px; color: #e5edf8; background: #111827; font: 14px/1.65 Consolas, Monaco, monospace; white-space: pre-wrap; tab-size: 2; }
.advanced-editor-shell.is-fullscreen { position: fixed; z-index: 3000; inset: 0; padding: 12px; display: flex; flex-direction: column; border-radius: 0; background: #eef2f7; }
.advanced-editor-shell.is-fullscreen .advanced-editor-actions { flex: 0 0 auto; }
.advanced-editor-shell.is-fullscreen .ck.ck-editor { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.advanced-editor-shell.is-fullscreen .ck.ck-editor__main { min-height: 0; flex: 1 1 auto; display: flex; }
.advanced-editor-shell.is-fullscreen .ck-editor__editable_inline { width: 100%; min-height: 100%; max-height: none; }
.advanced-editor-shell.is-fullscreen .advanced-editor-source { min-height: 0 !important; max-height: none; flex: 1 1 auto; resize: none; }
.editor-fullscreen-open { overflow: hidden; }
.form-section { padding: 23px; }
.form-title { margin-bottom: 20px; padding-bottom: 13px; border-bottom: 1px solid var(--admin-border); }
.image-preview { height: 285px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 2px dashed #d4dae2; border-radius: 9px; color: #929baa; background: #fafbfc; }
.image-preview img { width: 100%; height: 100%; object-fit: contain; }
.image-preview i { font-size: 45px; }
.site-media-card { height: calc(100% - 1.5rem); }
.site-image-preview {
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #d4dae2;
  border-radius: 9px;
  background: #f4f7fa;
}
.site-image-preview img { width: 100%; height: 100%; display: block; object-fit: contain; }
.site-image-preview-hero { aspect-ratio: 1920 / 725; }
.site-image-preview-mobile { max-height: 310px; aspect-ratio: 768 / 900; }
.site-image-preview-about { aspect-ratio: 4 / 3; }
.custom-file-label { overflow: hidden; white-space: nowrap; }
.workflow-card { height: 100%; padding: 22px; display: block; color: inherit; }
.workflow-card:hover { color: inherit; border-color: #bad078; transform: translateY(-3px); }
.workflow-number { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: var(--admin-blue); font-weight: 800; }
.workflow-card h3 { margin: 17px 0 7px; font-size: 18px; font-weight: 800; }
.workflow-card p { margin: 0; color: var(--admin-muted); line-height: 1.5; }
.low-stock-list a { padding: 14px 18px; display: flex; justify-content: space-between; color: inherit; border-bottom: 1px solid var(--admin-border); }
.low-stock-list strong, .low-stock-list small { display: block; }
.low-stock-list small { margin-top: 3px; color: var(--admin-muted); }
.order-item { padding: 15px 18px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--admin-border); }
.order-item img { width: 58px; height: 58px; object-fit: contain; border-radius: 6px; background: #f6f7f9; }
.order-item .grow { flex: 1; }
.order-item strong, .order-item small { display: block; }
.order-item small { color: var(--admin-muted); }
.order-totals { max-width: 390px; padding: 20px; margin-left: auto; }
.order-totals div { padding: 7px 0; display: flex; justify-content: space-between; }
.order-totals .total { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--admin-border); font-size: 18px; }
.admin-login-body { min-height: 100vh; padding: 25px; display: flex; align-items: center; justify-content: center; background: linear-gradient(rgba(3,24,51,.88),rgba(3,24,51,.88)), url('/assets/images/banners/banner1.png') center/cover; }
.admin-login-card { width: 100%; max-width: 430px; padding: 36px; border-radius: 14px; background: #fff; box-shadow: 0 25px 70px rgba(0,0,0,.28); }
.login-logo { text-align: center; }
.login-logo img { width: 180px; height: 105px; object-fit: contain; }
.admin-login-card h1 { margin: 20px 0 8px; text-align: center; font-size: 27px; font-weight: 800; }
.admin-login-card > p { margin-bottom: 24px; color: var(--admin-muted); text-align: center; }
.password-field { position: relative; }
.password-field input { padding-right: 45px; }
.password-field button { position: absolute; top: 0; right: 0; width: 44px; height: 44px; border: 0; background: transparent; }
.back-store { margin-top: 20px; display: block; color: var(--admin-muted); text-align: center; }

@media (max-width: 991.98px) {
  .admin-menu-toggle { display: block; }
  .admin-sidebar { z-index: 1060; top: 0; width: 270px; padding-top: 25px; transform: translateX(-100%); transition: transform .22s ease; }
  .admin-menu-open .admin-sidebar { transform: translateX(0); }
  .admin-sidebar-backdrop { position: fixed; z-index: 1055; inset: 0; border: 0; background: rgba(3,20,41,.5); }
  .admin-menu-open .admin-sidebar-backdrop { display: block; }
  .admin-content { width: 100%; margin-left: 0; padding: 24px 20px; }
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .admin-topbar { height: 64px; padding: 0 11px; }
  .admin-brand img { width: 50px; height: 42px; }
  .admin-brand span, .admin-user > span { display: none; }
  .admin-layout { padding-top: 64px; }
  .admin-sidebar { top: 0; bottom: 0; width: min(290px, 86vw); height: auto; padding: 25px 16px; overflow-y: auto; border-top: 0; }
  .admin-sidebar nav { display: block; min-width: 0; }
  .admin-sidebar a { width: auto; margin-bottom: 7px; }
  .admin-content { width: 100%; margin: 0; padding: 18px 12px 30px; }
  .dashboard-stats { grid-template-columns: 1fr; gap: 12px; }
  .stat-card { min-height: 96px; }
  .admin-page-heading { align-items: flex-start; }
  .admin-page-heading h1 { font-size: 23px; }
  .admin-actions .btn span { display: none; }
  .admin-search { flex-wrap: wrap; }
  .admin-search .form-control { width: 170px; }
  .admin-login-card { padding: 28px 22px; }
  .product-description-textarea { height: 180px; max-height: 65vh; }
  .ck-editor__editable_inline { min-height: 300px; max-height: 65vh; }
  .advanced-editor-actions { justify-content: stretch; }
  .advanced-editor-action { flex: 1; }
  .advanced-editor-action i { display: none; }
  .advanced-editor-shell.is-fullscreen { padding: 0; }
}
.shipping-details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.shipping-details-grid > div {
  border: 1px solid #e3e9ef;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.shipping-details-grid small,
.shipping-details-grid strong {
  display: block;
}

.shipping-details-grid small {
  color: #6c7888;
  margin-bottom: 4px;
}

.courier-rate-list {
  border: 1px solid #e3e9ef;
  border-radius: 10px;
  overflow: hidden;
}

.courier-rate-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e3e9ef;
}

.courier-rate-list > div:last-child {
  border-bottom: 0;
}

.shipping-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.price-request-admin-form { min-width: 180px; display: grid; gap: 7px; }

@media (max-width: 767px) {
  .shipping-details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


.brand-entity-cell img { object-fit: contain !important; background: #fff; padding: 5px; }
.brand-logo-preview { min-height: 220px; border: 1px dashed #cfd8e3; border-radius: 12px; background: #f8fafc; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; padding: 22px; color: #738094; text-align: center; }
.brand-logo-preview img { width: 100%; max-width: 280px; max-height: 140px; object-fit: contain; background: #fff; border-radius: 8px; padding: 12px; border: 1px solid #e4e9ef; }
.brand-logo-preview i { font-size: 44px; }
