/* SeeCommerce Admin Styles */

.seecommerce-admin {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* Page Header */
.seecommerce-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid #ddd;
}

.seecommerce-page-header h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 400;
  line-height: 1.3;
}

.seecommerce-page-header .description {
  margin: 5px 0 0 0;
  color: #646970;
}

/* Loading State */
.seecommerce-loading {
  text-align: center;
  padding: 40px;
  color: #646970;
}

.seecommerce-loading p {
  margin: 0;
}

/* Empty State */
.seecommerce-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.seecommerce-empty-state .empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.seecommerce-empty-state h2 {
  font-size: 24px;
  margin: 0 0 10px;
}

.seecommerce-empty-state p {
  color: #646970;
  margin-bottom: 20px;
}

/* Stats Grid - Dashboard */
.seecommerce-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.seecommerce-stat-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: box-shadow 0.2s;
}

.seecommerce-stat-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.seecommerce-stat-card .stat-icon {
  font-size: 32px;
  opacity: 0.7;
}

.seecommerce-stat-card .stat-content {
  flex: 1;
}

.seecommerce-stat-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: #646970;
}

.seecommerce-stat-card .stat-value {
  font-size: 32px;
  font-weight: 600;
  color: #1d2327;
  margin-bottom: 5px;
}

.seecommerce-stat-card .stat-label {
  font-size: 12px;
  color: #646970;
}

.seecommerce-stat-card a {
  font-size: 13px;
  text-decoration: none;
}

/* Quick Actions */
.seecommerce-quick-actions {
  margin-bottom: 30px;
}

.seecommerce-quick-actions h2 {
  font-size: 18px;
  margin-bottom: 15px;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.quick-action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: #1d2327;
  transition: all 0.2s;
}

.quick-action-card:hover {
  border-color: #2271b1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quick-action-card .action-icon {
  font-size: 24px;
}

.quick-action-card .action-label {
  font-weight: 500;
}

/* Welcome Card */
.seecommerce-welcome-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 25px;
}

.seecommerce-welcome-card h2 {
  margin-top: 0;
}

.seecommerce-welcome-card ul,
.seecommerce-welcome-card ol {
  margin: 15px 0;
}

/* Toolbar */
.seecommerce-toolbar {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar-search {
  flex: 1;
  min-width: 250px;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
}

/* Bulk Actions */
.seecommerce-bulk-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: #f0f6fc;
  border: 1px solid #c3e7ff;
  border-radius: 4px;
  margin-bottom: 15px;
}

.seecommerce-bulk-actions span {
  font-weight: 600;
}

.button-danger {
  background: #d63638 !important;
  border-color: #d63638 !important;
  color: #fff !important;
}

.button-danger:hover {
  background: #b32d2e !important;
}

/* Table */
.seecommerce-table-container {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow-x: auto;
}

.seecommerce-table {
  width: 100%;
  border-collapse: collapse;
}

.seecommerce-table thead {
  background: #f6f7f7;
  border-bottom: 1px solid #ddd;
}

.seecommerce-table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #1d2327;
}

.seecommerce-table td {
  padding: 12px;
  border-top: 1px solid #f0f0f1;
}

.seecommerce-table tbody tr:hover {
  background: #f6f7f7;
}

.seecommerce-table .check-column {
  width: 40px;
  text-align: center;
}

.seecommerce-table .actions {
  white-space: nowrap;
}

.seecommerce-table .no-items {
  text-align: center;
  color: #646970;
  padding: 30px;
}

.seecommerce-table .text-right {
  text-align: right;
}

.seecommerce-table .text-muted {
  color: #646970;
  font-size: 13px;
}

/* Product Image */
.product-image {
  width: 50px;
  height: 50px;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-image {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f1;
  border-radius: 4px;
  font-size: 24px;
}

/* Badges */
.status-badge,
.stock-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.status-badge.published {
  background: #d5f4e6;
  color: #087f5b;
}

.status-badge.draft {
  background: #f0f0f1;
  color: #646970;
}

.stock-badge.instock {
  background: #d5f4e6;
  color: #087f5b;
}

.stock-badge.outofstock {
  background: #fee;
  color: #d63638;
}

.status-pending {
  background: #fcf3cf;
  color: #856404;
}

.status-processing {
  background: #d4edff;
  color: #0051a2;
}

.status-completed {
  background: #d5f4e6;
  color: #087f5b;
}

.status-cancelled,
.status-refunded {
  background: #fee;
  color: #d63638;
}

/* Buttons */
.button-link {
  background: none;
  border: none;
  color: #2271b1;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
  margin-right: 10px;
  font-size: 13px;
}

.button-link:hover {
  text-decoration: underline;
  color: #135e96;
}

.button.button-link-delete {
  background: #d63638 !important;
  border-color: #d63638 !important;
  color: #fff !important;
  width: auto !important;
  height: auto !important;
  border-radius: 4px !important;
  display: inline-block !important;
}

.button.button-link-delete:hover {
  background: #b32d2e !important;
  border-color: #b32d2e !important;
  color: #fff !important;
}

.button.button-link-delete:focus {
  background: #b32d2e !important;
  border-color: #b32d2e !important;
  color: #fff !important;
  box-shadow: 0 0 0 1px #fff, 0 0 0 3px #b32d2e !important;
}

/* Product Form */
.seecommerce-product-form {
  max-width: 100%;
}

.form-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
}

.form-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 20px;
}

.form-card h2 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f1;
}

.form-field {
  margin-bottom: 20px;
}

.form-field:last-child {
  margin-bottom: 0;
}

.form-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #1d2327;
}

.form-field .required {
  color: #d63638;
}

.form-field .description {
  margin-top: 5px;
  font-size: 13px;
  color: #646970;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="number"],
.form-field input[type="tel"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
}

.form-field textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid #f0f0f1;
}

/* Settings */
.seecommerce-settings {
  max-width: 100%;
}

.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.settings-nav .nav-item {
  padding: 10px 15px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: #1d2327;
  transition: all 0.2s;
}

.settings-nav .nav-item:hover {
  background: #f6f7f7;
}

.settings-nav .nav-item.active {
  background: #2271b1;
  color: #fff;
  border-color: #2271b1;
}

.settings-content {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 25px;
}

.settings-section h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 18px;
}

.payment-gateway-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.gateway-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.gateway-info h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.gateway-info p {
  margin: 0;
  color: #646970;
  font-size: 13px;
}

.gateway-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.badge {
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
}

.badge-inactive {
  background: #f0f0f1;
  color: #646970;
}

.badge-active {
  background: #d5f4e6;
  color: #087f5b;
}

.info-box {
  padding: 15px;
  background: #f0f6fc;
  border: 1px solid #c3e7ff;
  border-radius: 4px;
  margin-top: 15px;
}

.info-box p {
  margin: 5px 0;
}

.save-indicator {
  color: #087f5b;
  font-weight: 500;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 1200px) {
  .form-layout {
    grid-template-columns: 1fr;
  }

  .form-sidebar {
    order: -1;
  }
}

@media (max-width: 782px) {
  .seecommerce-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .seecommerce-toolbar {
    flex-direction: column;
  }

  .toolbar-search {
    min-width: 100%;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .seecommerce-table {
    font-size: 13px;
  }

  .seecommerce-table td,
  .seecommerce-table th {
    padding: 8px;
  }
}

/* Order Detail Page */
.seecommerce-order-detail .seecommerce-page-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
}

.seecommerce-order-detail .header-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.seecommerce-order-detail .header-title {
  display: flex;
  align-items: center;
  gap: 15px;
}

.seecommerce-order-detail .order-number {
  font-size: 18px;
  color: #646970;
  font-weight: 500;
}

.seecommerce-order-detail .button-back {
  background: none;
  border: none;
  color: #2271b1;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
}

.seecommerce-order-detail .button-back:hover {
  color: #135e96;
  text-decoration: underline;
}

.seecommerce-order-detail .header-actions {
  display: flex;
  gap: 10px;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 20px;
  margin-top: 20px;
}

.order-detail-main,
.order-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 20px;
}

.detail-card h2 {
  margin: 0 0 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #ddd;
  font-size: 18px;
  font-weight: 600;
}

/* Order Items Table */
.order-items-table table {
  width: 100%;
  border-collapse: collapse;
}

.order-items-table thead th {
  background: #f6f7f7;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
}

.order-items-table tbody td {
  padding: 12px;
  border-bottom: 1px solid #f0f0f1;
}

.order-items-table tbody tr:last-child td {
  border-bottom: none;
}

.order-items-table tfoot td {
  padding: 12px;
  border-top: 2px solid #ddd;
  font-weight: 500;
}

.order-items-table tfoot tr.total-row td {
  padding-top: 15px;
  font-size: 16px;
  font-weight: 700;
  color: #000;
}

.order-items-table .text-center {
  text-align: center;
}

.order-items-table .text-right {
  text-align: right;
}

/* Address Info */
.address-info p {
  margin: 0 0 8px;
  line-height: 1.6;
  color: #2c3338;
}

.address-info p:last-child {
  margin-bottom: 0;
}

.address-info strong {
  color: #000;
}

/* Info List */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f1;
}

.info-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-item .label {
  font-size: 13px;
  color: #646970;
  font-weight: 500;
}

.info-item .value {
  font-size: 14px;
  color: #2c3338;
  font-weight: 600;
}

/* Status Update Form */
.status-update-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-update-form .status-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

.status-update-form .status-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status-update-form .updating-text {
  margin: 0;
  font-size: 13px;
  color: #646970;
  font-style: italic;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-buttons .button {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* =====================================================
   PRINT STYLES - BACKEND ORDER DETAIL
   ===================================================== */
@media print {
  /* Hide all WordPress admin UI */
  #wpadminbar,
  #adminmenumain,
  #adminmenuback,
  #wpfooter,
  .update-nag,
  .notice {
    display: none !important;
  }

  /* Hide buttons and unwanted sidebar cards */
  .button-back,
  .header-actions,
  .order-detail-sidebar > div:nth-child(2),
  .order-detail-sidebar > div:nth-child(3) {
    display: none !important;
  }

  /* Page setup */
  @page {
    margin: 1cm;
  }

  /* Complete reset */
  * {
    box-sizing: border-box !important;
  }

  html,
  body {
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #wpwrap,
  #wpcontent,
  #wpbody,
  #wpbody-content,
  .wrap {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Main container */
  .seecommerce-order-detail {
    width: 100% !important;
    padding: 0 20px !important;
  }

  /* Header */
  .seecommerce-page-header {
    text-align: center !important;
    padding: 0 0 10px 0 !important;
    margin: 0 0 20px 0 !important;
    border-bottom: 2px solid #000 !important;
  }

  .seecommerce-page-header h1 {
    font-size: 0 !important;
    margin: 0 !important;
  }

  .seecommerce-page-header h1::after {
    content: "Order Confirmed!" !important;
    font-size: 24px !important;
    color: #000 !important;
    font-weight: 600 !important;
  }

  .order-number {
    display: none !important;
  }

  /* LAYOUT: Use CSS Grid for precise control */
  .order-detail-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 0 !important;
    width: 100% !important;
  }

  /* Make sidebar and main transparent - use display: contents */
  .order-detail-sidebar,
  .order-detail-main {
    display: contents !important;
  }

  /* Card 1: Order Information (from sidebar, 1st child) - Position: Row 1, Col 1 */
  .order-detail-sidebar > .detail-card:nth-child(1) {
    grid-row: 1 !important;
    grid-column: 1 !important;
    margin: 0 0.75rem 0 0 !important;
    padding: 12px !important;
    border: 1px solid #000 !important;
    background: #fff !important;
  }

  /* Rename "Order Information" to "Order Detail" */
  .order-detail-sidebar > .detail-card:nth-child(1) h2 {
    font-size: 0 !important;
  }

  .order-detail-sidebar > .detail-card:nth-child(1) h2::after {
    content: "Order Detail" !important;
    font-size: 14px !important;
  }

  /* Card 2: Billing Address (from main, 2nd child) - Position: Row 1, Col 2 */
  .order-detail-main > .detail-card:nth-child(2) {
    grid-row: 1 !important;
    grid-column: 2 !important;
    margin: 0 !important;
    padding: 12px !important;
    border: 1px solid #000 !important;
    background: #fff !important;
  }

  /* Card 3: Shipping Address (from main, 3rd child) - Position: Row 1, Col 3 */
  .order-detail-main > .detail-card:nth-child(3) {
    grid-row: 1 !important;
    grid-column: 3 !important;
    margin: 0 0 0 0.75rem !important;
    padding: 12px !important;
    border: 1px solid #000 !important;
    background: #fff !important;
  }

  /* Card 4: Order Items (from main, 1st child) - Position: Row 2, Span all 3 columns */
  .order-detail-main > .detail-card:nth-child(1) {
    grid-row: 2 !important;
    grid-column: 1 / 4 !important;
    margin: 15px 0 0 0 !important;
    padding: 15px !important;
    border: 1px solid #000 !important;
    background: #fff !important;
  }

  /* Rename "Order Items" to "Order Summary" */
  .order-detail-main > .detail-card:nth-child(1) h2 {
    font-size: 0 !important;
  }

  .order-detail-main > .detail-card:nth-child(1) h2::after {
    content: "Order Summary" !important;
    font-size: 16px !important;
  }

  /* Card titles */
  .detail-card h2 {
    margin: 0 0 10px 0 !important;
    padding: 0 0 6px 0 !important;
    border-bottom: 2px solid #000 !important;
    color: #000 !important;
    font-weight: 600 !important;
  }

  /* Order Info items */
  .info-list {
    margin: 0 !important;
    padding: 0 !important;
  }

  .info-item {
    margin: 0 0 10px 0 !important;
    padding: 0 0 8px 0 !important;
    border-bottom: 1px solid #ddd !important;
  }

  .info-item:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
  }

  .info-item .label {
    display: block !important;
    font-size: 11px !important;
    color: #666 !important;
    margin: 0 0 3px 0 !important;
  }

  .info-item .value {
    display: block !important;
    font-size: 13px !important;
    color: #000 !important;
    font-weight: 600 !important;
  }

  /* Address */
  .address-info p {
    margin: 0 0 4px 0 !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
    color: #000 !important;
  }

  /* Order Items Table */
  .order-items-table table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  .order-items-table thead th {
    background: #f0f0f0 !important;
    border: 1px solid #000 !important;
    padding: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-align: left !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .order-items-table tbody td {
    border: 1px solid #ddd !important;
    padding: 10px !important;
    font-size: 13px !important;
  }

  .order-items-table tfoot td {
    border: 1px solid #ddd !important;
    padding: 10px !important;
    font-size: 13px !important;
  }

  .order-items-table tfoot {
    border-top: 2px solid #000 !important;
  }

  .order-items-table .total-row td {
    font-size: 16px !important;
    font-weight: 700 !important;
    border-top: 2px solid #000 !important;
    padding-top: 12px !important;
  }

  .text-center {
    text-align: center !important;
  }

  .text-right {
    text-align: right !important;
  }

  /* Status badges */
  .status-badge {
    padding: 4px 8px !important;
    font-size: 11px !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Responsive Order Detail */
@media (max-width: 1200px) {
  .order-detail-grid {
    grid-template-columns: 1fr;
  }

  .order-detail-sidebar {
    order: -1;
  }
}

@media (max-width: 768px) {
  .order-items-table table {
    font-size: 13px;
  }

  .order-items-table thead th,
  .order-items-table tbody td,
  .order-items-table tfoot td {
    padding: 8px;
  }

  .seecommerce-order-detail .header-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

/* Email Templates Styles */
.seecommerce-email-templates {
  padding: 20px;
  max-width: 100%;
}

.seecommerce-email-templates .seecommerce-page-header {
  margin-bottom: 20px;
}

.seecommerce-email-templates .seecommerce-page-header h1 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 600;
}

.seecommerce-email-templates .description {
  color: #666;
  font-size: 14px;
  margin: 0;
}

/* Email Templates Layout */
.email-templates-layout {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

/* Templates Sidebar */
.templates-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 32px;
}

.templates-sidebar h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1d2327;
}

.templates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-item {
  padding: 12px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.template-item:hover {
  background: #f0f0f0;
  border-color: #2271b1;
}

.template-item.active {
  background: #f0f6fc;
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
}

.template-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.template-item h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1d2327;
}

.template-status {
  font-size: 12px;
  margin-left: 8px;
}

.template-status.enabled {
  color: #46b450;
}

.template-status.disabled {
  color: #999;
}

.template-recipient {
  margin: 0;
  font-size: 12px;
  color: #666;
}

/* Templates Content */
.templates-content {
  flex: 1;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0;
  min-height: 600px;
}

.template-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #ddd;
}

.template-title {
  display: flex;
  align-items: center;
  gap: 20px;
}

.template-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.template-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-label {
  font-size: 14px;
  color: #666;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2271b1;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.template-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.save-indicator {
  color: #46b450;
  font-size: 14px;
  font-weight: 500;
}

/* Template Tabs */
.template-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #ddd;
  padding: 0 20px;
  background: #f9f9f9;
}

.tab-button {
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  transition: all 0.2s ease;
}

.tab-button:hover {
  color: #2271b1;
}

.tab-button.active {
  color: #2271b1;
  border-bottom-color: #2271b1;
  background: #fff;
}

/* Template Editor */
.template-editor {
  padding: 20px;
}

.editor-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  font-weight: 600;
  font-size: 14px;
  color: #1d2327;
}

.form-field input[type='text'],
.form-field textarea {
  padding: 8px 12px;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

.form-field input[type='text']:focus,
.form-field textarea:focus {
  border-color: #2271b1;
  outline: none;
  box-shadow: 0 0 0 1px #2271b1;
}

.form-field textarea.code-editor {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.form-field .description {
  font-size: 13px;
  color: #666;
  font-style: italic;
  margin: 0;
}

/* Quick Variables */
.quick-variables {
  margin-top: 20px;
  padding: 15px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.quick-variables h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
}

.variable-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variable-button {
  padding: 6px 12px;
  font-size: 12px;
  font-family: 'Courier New', Courier, monospace;
  background: #fff;
  border: 1px solid #8c8f94;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.variable-button:hover {
  background: #f0f0f0;
  border-color: #2271b1;
  color: #2271b1;
}

/* Variables Reference */
.variables-reference {
  max-width: 900px;
}

.variables-reference h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: 600;
}

.variables-reference .description {
  margin-bottom: 20px;
}

.variables-reference table {
  margin-bottom: 30px;
}

.variables-reference table code {
  background: #f0f0f0;
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 13px;
}

.variables-example {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
}

.variables-example h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
}

.code-example {
  background: #1d2327;
  color: #f0f0f0;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

/* No Template Selected */
.no-template-selected {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 400px;
  color: #666;
  font-size: 16px;
}

/* Preview Modal */
.email-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 20px;
}

.preview-modal-content {
  background: #fff;
  border-radius: 8px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #ddd;
}

.preview-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.close-button {
  background: transparent;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-button:hover {
  background: #f0f0f0;
  color: #000;
}

.preview-modal-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.preview-iframe-wrapper {
  min-height: 400px;
}

/* Loading State */
.seecommerce-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  font-size: 16px;
  color: #666;
}

/* Responsive */
@media (max-width: 1024px) {
  .email-templates-layout {
    flex-direction: column;
  }

  .templates-sidebar {
    width: 100%;
    position: static;
  }

  .templates-list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .template-item {
    flex: 1;
    min-width: 200px;
  }
}

@media (max-width: 768px) {
  .template-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .template-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .templates-list {
    flex-direction: column;
  }

  .template-item {
    min-width: auto;
  }
}

/* Checkout Fields Configuration */
.checkout-fields-config {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.checkout-fields-config h3 {
  margin: 24px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #2271b1;
  color: #1d2327;
  font-size: 18px;
}

.checkout-fields-config h3:first-of-type {
  margin-top: 0;
}

.field-config-item {
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  padding: 20px;
}

.field-config-item h4 {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: #1d2327;
}

.field-config-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}

.field-config-controls .form-field {
  margin-bottom: 0;
}

.field-config-controls .checkbox-field {
  display: flex;
  align-items: center;
  padding-top: 8px;
}

.field-config-controls .checkbox-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  cursor: pointer;
}

.field-config-controls .checkbox-field input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .field-config-controls {
    grid-template-columns: 1fr;
  }

  .field-config-controls .checkbox-field {
    padding-top: 0;
  }
}

/* Product Images */
.image-upload-field {
  margin-top: 8px;
}

.image-preview {
  border: 1px solid #dcdcde;
  border-radius: 4px;
  padding: 12px;
  background: #fff;
}

.image-preview img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 2px;
  margin-bottom: 12px;
}

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

.gallery-preview {
  border: 1px solid #dcdcde;
  border-radius: 4px;
  padding: 12px;
  background: #fff;
}

.gallery-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.gallery-image {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
}

.gallery-image img {
  display: block;
  width: 100%;
  height: 100%;
}

/* Order Number Settings */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 2px solid #dcdcde;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.radio-option:hover {
  border-color: #2271b1;
  background-color: #f6f7f7;
}

.radio-option input[type="radio"] {
  margin-top: 2px;
  flex-shrink: 0;
}

.radio-option input[type="radio"]:checked + .radio-content {
  color: #2271b1;
}

.radio-option input[type="radio"]:checked {
  accent-color: #2271b1;
}

.radio-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.radio-content strong {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.radio-description {
  font-size: 13px;
  color: #646970;
  line-height: 1.5;
}

.badge.recommended {
  display: inline-block;
  padding: 2px 8px;
  background: #007cba;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.radio-group-inline {
  display: flex;
  gap: 24px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.radio-group-inline label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.radio-group-inline input[type="radio"] {
  accent-color: #2271b1;
}

.order-number-preview {
  margin-top: 24px;
  padding: 20px;
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 8px;
}

.order-number-preview label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
  color: #1d2327;
}

.preview-box {
  background: #fff;
  padding: 16px 20px;
  border: 2px solid #2271b1;
  border-radius: 6px;
  margin-bottom: 8px;
}

.preview-box code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  color: #2271b1;
  letter-spacing: 1px;
}

.field-description {
  font-size: 13px;
  color: #646970;
  margin-top: 6px;
  line-height: 1.5;
}

/* Customer Notes in Order Detail */
.customer-note-content {
  background: #f9fafb;
  border-left: 4px solid #2271b1;
  padding: 16px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.6;
  color: #1d2327;
}

.customer-note-content p {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 20px;
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #dcdcde;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #646970;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.modal-close:hover {
  background: #f0f0f1;
  color: #1d2327;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #dcdcde;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
