<?php
/**
 * Shared admin theme: layout, sidebar, alerts, forms, tables, buttons, cards.
 * Self-contained — Vintage Doors brand tokens (no external common.css).
 * Include in <head> on every admin page.
 */
?>
<style>
  :root {
    /* Vintage Doors brand palette */
    --primaryColor: #002031;
    --primary400Color: #00476C;
    --primary300Color: #1179B0;
    --primary200Color: #CEEEFF;
    --primary100Color: #EAF8FF;
    --secondaryColor: #b09e60;
    --secondary500Color: #453211;
    --secondary400Color: #806730;
    --secondary200Color: #DED6BD;
    --secondary100Color: #EFECDF;
    --woodDustColor: #C3BBAE;
    --woodDust500Color: #484135;
    --woodDust400Color: #766B59;
    --woodDust200Color: #EDE9E3;
    --woodDust100Color: #FBF9F4;
    --greysColor: #E7E7E7;
    --greys500Color: #4E4E4E;
    --greys400Color: #736F6B;
    --greys300Color: #989693;
    --greys100Color: #F8F8F8;
    --sootBlackColor: #222222;
    --silkWhiteColor: #FDFEFF;
    --alertRedColor: #C42700;
    --font-stack-header: Georgia, 'Times New Roman', serif;
    --font-stack-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --admin-sidebar-width: 260px;
    --admin-sidebar-collapsed: 52px;
    --admin-transition: 0.15s ease;
    /* Shopify admin nav tokens */
    --shopify-nav-bg: #f6f6f7;
    --shopify-nav-border: #e3e3e3;
    --shopify-nav-text: #616161;
    --shopify-nav-text-active: #303030;
    --shopify-nav-hover-bg: #ededed;
    --shopify-nav-active-bg: #ffffff;
    --shopify-nav-section: #8c9196;
  }

  body.admin-app {
    margin: 0;
    padding: 0;
    background: var(--silkWhiteColor);
    color: var(--sootBlackColor);
    font-family: var(--font-stack-body);
    font-size: 16px;
    line-height: 150%;
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
  }

  body.admin-app * { box-sizing: border-box; }

  /* ----- Sidebar (Vintage Doors admin) ----- */
  .admin-sidebar {
    width: var(--admin-sidebar-width);
    min-width: var(--admin-sidebar-width);
    background: var(--woodDust100Color);
    border-right: 1px solid var(--greysColor);
    padding: 0;
    flex-shrink: 0;
    transition: width var(--admin-transition), min-width var(--admin-transition);
    position: sticky;
    top: 0;
    align-self: flex-start;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .admin-sidebar--collapsed {
    width: var(--admin-sidebar-collapsed);
    min-width: var(--admin-sidebar-collapsed);
  }
  .admin-sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px 14px 16px;
    border-bottom: 1px solid var(--greysColor);
    min-height: 60px;
    background: var(--silkWhiteColor);
    flex-shrink: 0;
  }
  .admin-sidebar--collapsed .admin-sidebar-header {
    padding: 12px 8px;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    min-height: auto;
  }
  .admin-sidebar-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primaryColor);
    color: var(--silkWhiteColor);
    border-radius: 8px;
    box-shadow: none;
  }
  .admin-sidebar--collapsed .admin-sidebar-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
  }
  .admin-sidebar-icon svg { width: 18px; height: 18px; display: block; }
  .admin-sidebar--collapsed .admin-sidebar-icon svg { width: 16px; height: 16px; }
  .admin-sidebar-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 8px;
  }
  .admin-sidebar-title {
    font-family: var(--font-stack-header);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.3;
    color: var(--primaryColor);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0;
    transition: opacity 0.15s ease;
  }
  .admin-sidebar--collapsed .admin-sidebar-title { display: none; }
  .admin-sidebar-toggle {
    position: relative;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--shopify-nav-text);
    cursor: pointer;
    transition: background var(--admin-transition), color var(--admin-transition);
  }
  .admin-sidebar-toggle:hover {
    background: var(--shopify-nav-hover-bg);
    color: var(--shopify-nav-text-active);
  }
  .admin-sidebar-toggle-icon { position: absolute; pointer-events: none; }
  .admin-sidebar-toggle .admin-sidebar-toggle-icon--collapse { display: block; }
  .admin-sidebar-toggle .admin-sidebar-toggle-icon--expand { display: none; }
  .admin-sidebar--collapsed .admin-sidebar-toggle .admin-sidebar-toggle-icon--collapse { display: none; }
  .admin-sidebar--collapsed .admin-sidebar-toggle .admin-sidebar-toggle-icon--expand { display: block; }
  .admin-sidebar-section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 6px;
    padding: 0 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--greys400Color);
    line-height: 1.3;
  }
  .admin-sidebar-section-label__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .admin-sidebar-section-count {
    flex-shrink: 0;
    min-width: 1.25rem;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    color: var(--primary400Color);
    background: var(--primary100Color);
    border: 1px solid var(--primary200Color);
  }
  .admin-sidebar--collapsed .admin-sidebar-section-label {
    justify-content: center;
    padding: 0;
    margin-bottom: 8px;
  }
  .admin-sidebar--collapsed .admin-sidebar-section-label__text,
  .admin-sidebar--collapsed .admin-sidebar-section-count {
    display: none;
  }
  .admin-sidebar--collapsed .admin-sidebar-section-label::before {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 1px;
    background: var(--greysColor);
  }
  .admin-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 10px 8px;
  }
  .admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: var(--greys500Color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background var(--admin-transition), color var(--admin-transition), border-color var(--admin-transition), box-shadow var(--admin-transition);
    min-width: 0;
  }
  .admin-sidebar-link-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: var(--greys400Color);
    transition: color var(--admin-transition);
  }
  .admin-sidebar-link-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .admin-sidebar--collapsed .admin-sidebar-link {
    justify-content: center;
    padding: 9px 8px;
    width: 36px;
    margin: 0 auto;
  }
  .admin-sidebar--collapsed .admin-sidebar-link-text {
    display: none;
  }
  .admin-sidebar-link:hover {
    color: var(--primaryColor);
    background: var(--silkWhiteColor);
    border-color: var(--greysColor);
    text-decoration: none;
  }
  .admin-sidebar-link:hover .admin-sidebar-link-icon {
    color: var(--primary300Color);
  }
  .admin-sidebar-link-active {
    color: var(--primaryColor);
    background: var(--silkWhiteColor);
    border-color: var(--primary200Color);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 32, 49, 0.08);
  }
  .admin-sidebar-link-active .admin-sidebar-link-icon {
    color: var(--primary300Color);
  }
  .admin-sidebar-link-active:hover {
    background: var(--silkWhiteColor);
    color: var(--primaryColor);
    border-color: var(--primary200Color);
  }
  .admin-sidebar-folder-configs {
    /*margin-top: auto;*/
    padding: 12px 10px 4px;
    border-top: 1px solid var(--greysColor);
    background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.55) 100%);
  }
  .admin-sidebar-config-tabs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: auto;
    overflow-y: auto;
    padding-right: 2px;
  }
  .admin-sidebar-config-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.35;
    color: var(--greys500Color);
    text-decoration: none;
    border: 1px solid var(--greysColor);
    background: var(--silkWhiteColor);
    min-width: 0;
    transition: background var(--admin-transition), color var(--admin-transition), border-color var(--admin-transition);
  }
  .admin-sidebar-config-tab:hover {
    color: var(--primaryColor);
    border-color: var(--primary200Color);
    background: var(--primary100Color);
    text-decoration: none;
  }
  .admin-sidebar-config-tab--active {
    color: var(--silkWhiteColor);
    background: var(--primaryColor);
    border-color: var(--primaryColor);
    cursor: default;
    box-shadow: 0 1px 3px rgba(0, 32, 49, 0.15);
  }
  .admin-sidebar-config-tab--active:hover {
    color: var(--silkWhiteColor);
    background: var(--primaryColor);
    border-color: var(--primaryColor);
  }
  .admin-sidebar-config-tab__id {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--primary300Color);
    background: var(--primary100Color);
    border: 1px solid var(--primary200Color);
    border-radius: 6px;
    padding: 2px 6px;
    line-height: 1.2;
  }
  .admin-sidebar-config-tab--active .admin-sidebar-config-tab__id {
    color: var(--silkWhiteColor);
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
  }
  .admin-sidebar-config-tab__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
  }
  .admin-sidebar--collapsed .admin-sidebar-config-tab {
    justify-content: center;
    padding: 7px 6px;
  }
  .admin-sidebar--collapsed .admin-sidebar-config-tab__title {
    display: none;
  }
  .admin-sidebar-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary300Color);
    text-decoration: none;
    transition: color var(--admin-transition);
  }
  .admin-sidebar-back-link svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
  }
  .admin-sidebar-back-link:hover {
    color: var(--primaryColor);
    text-decoration: underline;
  }
  .admin-sidebar--collapsed .admin-sidebar-back-link span {
    display: none;
  }
  .admin-sidebar--collapsed .admin-sidebar-back-link {
    justify-content: center;
    width: 36px;
    margin-inline: auto;
    padding: 6px;
  }
  .admin-sidebar-footer {
    flex-shrink: 0;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--greysColor);
    background: var(--silkWhiteColor);
  }
  .admin-sidebar-brand {
    display: block;
    font-family: var(--font-stack-header);
    font-size: 13px;
    font-weight: 400;
    color: var(--secondary400Color);
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .admin-sidebar--collapsed .admin-sidebar-brand {
    font-size: 0;
    text-align: center;
  }
  .admin-sidebar--collapsed .admin-sidebar-brand::before {
    content: 'VD';
    font-size: 11px;
    font-weight: 600;
    color: var(--secondaryColor);
    letter-spacing: 0.06em;
  }
  .admin-main {
    flex: 1;
    padding: 2rem 1rem 3rem;
    overflow-x: auto;
    min-width: 0;
    background: var(--silkWhiteColor);
  }
  .admin-wrap {
    max-width: 100%;
    margin: 0 auto;
    padding-inline: 10px;
  }

  /* ----- Page header ----- */
  .admin-page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--primary200Color);
  }
  .admin-page-header--folders {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
  }
  .admin-page-header__content { flex: 1; min-width: 0; }
  .admin-page-eyebrow {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary300Color);
    margin-bottom: 8px;
  }
  .admin-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 400;
    line-height: 150%;
  }
  .admin-breadcrumb a {
    color: var(--primaryColor);
    text-decoration: none;
    transition: color var(--admin-transition);
  }
  .admin-breadcrumb a:hover { text-decoration: underline; }
  .admin-breadcrumb span { color: var(--greys400Color); }
  .admin-page-title {
    margin: 0;
    font-family: var(--font-stack-header);
    font-weight: 400;
    font-size: 32px;
    line-height: 135%;
    letter-spacing: 0;
    color: var(--primaryColor);
  }
  .admin-page-meta {
    font-size: 16px;
    line-height: 150%;
    color: var(--greys400Color);
    margin: 8px 0 0;
    max-width: 640px;
  }

  /* ----- Alerts ----- */
  .admin-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 16px;
    line-height: 150%;
  }
  .admin-alert strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
  }
  .admin-alert a { font-weight: 600; text-decoration: underline; }
  .admin-alert a:hover { text-decoration: none; }
  .admin-alert--success {
    background: var(--silkWhiteColor);
    color: var(--primaryColor);
    border-color: var(--primary200Color);
    border-left: 4px solid var(--primary300Color);
  }
  .admin-alert--success a { color: var(--primary400Color); }
  .admin-alert--error {
    background: #fff5f2;
    color: var(--alertRedColor);
    border-color: #f5c4b8;
    border-left: 4px solid var(--alertRedColor);
  }
  .admin-alert--error a { color: var(--alertRedColor); }
  .admin-alert--warning {
    background: #fffbeb;
    color: var(--secondary500Color);
    border-color: var(--secondary200Color);
    border-left: 4px solid var(--secondaryColor);
  }
  .admin-alert--warning a { color: var(--secondary400Color); }
  .admin-alert--info {
    background: var(--silkWhiteColor);
    color: var(--primaryColor);
    border-color: var(--primary200Color);
    border-left: 4px solid var(--primary300Color);
  }
  .admin-alert--info a { color: var(--primary300Color); }

  /* ----- Cards ----- */
  .admin-card {
    background: var(--silkWhiteColor);
    border: 1px solid var(--greysColor);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    transition: border-color var(--admin-transition), box-shadow var(--admin-transition);
  }
  .admin-card--table {
    padding: 0;
    overflow: hidden;
    background: var(--silkWhiteColor);
    border: 1px solid var(--greysColor);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 32, 49, 0.05);
  }
  .admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 16px 24px;
    border-bottom: 1px solid var(--greysColor);
    background: var(--silkWhiteColor);
  }
  .admin-card--table .admin-card-header {
    padding: 20px 24px 20px 28px;
    border-bottom: 1px solid var(--greysColor);
    position: relative;
  }
  .admin-card--table .admin-card-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primaryColor);
  }
  .admin-card--table .admin-card-title {
    margin: 0;
    font-family: var(--font-stack-header);
    font-size: 20px;
    font-weight: 400;
    line-height: 135%;
    letter-spacing: 0;
    text-transform: none;
    color: var(--primaryColor);
  }
  .admin-card-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primaryColor);
    margin: 0 0 16px 0;
  }
  .admin-card-body { margin-top: 8px; }
  .admin-card--table .admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .admin-card--table .admin-empty {
    padding: 56px 24px;
    background: var(--silkWhiteColor);
  }
  .admin-card--table .admin-empty--icon .admin-empty-icon {
    background: var(--greys100Color);
    border-color: var(--greysColor);
  }

  /* ----- Buttons (aligned with .common-btn) ----- */
  .admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 24px;
    font-family: var(--font-stack-body);
    font-size: 16px;
    font-weight: 600;
    line-height: 150%;
    letter-spacing: 0;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: fit-content;
    transition: 0.3s linear;
    box-shadow: none;
  }
  .admin-btn:hover { text-decoration: none; }
  .admin-btn--primary {
    background: var(--primaryColor);
    color: var(--silkWhiteColor);
  }
  .admin-btn--primary:hover {
    background: var(--primary300Color);
    border-color: var(--primary300Color);
  }
  .admin-btn--success {
    background: var(--primary400Color);
    border: 1px solid var(--primary400Color);
    color: var(--silkWhiteColor);
  }
  .admin-btn--success:hover {
    background: var(--primary300Color);
    border-color: var(--primary300Color);
    color: var(--silkWhiteColor);
  }
  .admin-btn--secondary {
    background: transparent;
    color: var(--primaryColor);
    border: 1px solid var(--primaryColor);
    opacity:0.5;
    pointer-events: none;
  }
  .admin-btn--secondary:hover {
    border-color: var(--primary300Color);
    background: var(--greys100Color);
  }
  .admin-btn--muted {
    background: var(--greysColor);
    color: var(--greys400Color);
    cursor: default;
  }
  .admin-btn--sm {
    padding: 8px 16px;
    font-size: 14px;
    gap: 8px;
  }

  /* ----- Forms (aligned with .form-field) ----- */
  .admin-form-group { margin-bottom: 20px; }
  .admin-form-group:last-child { margin-bottom: 0; }
  .admin-label {
    display: block;
    font-weight: 600;
    font-size: 16px;
    line-height: 150%;
    color: var(--sootBlackColor);
    margin-bottom: 8px;
  }
  .admin-input,
  .admin-select,
  .admin-textarea {
    width: 100%;
    padding: 8px 16px;
    font-size: 16px;
    line-height: 150%;
    color: var(--sootBlackColor);
    background: var(--silkWhiteColor);
    border: 1px solid var(--greys300Color);
    border-radius: 8px;
    transition: border-color var(--admin-transition), box-shadow var(--admin-transition);
  }
  .admin-input:focus,
  .admin-select:focus,
  .admin-textarea:focus {
    outline: none;
    border-color: var(--primary300Color);
    box-shadow: 0 0 0 3px var(--primary100Color);
  }
  .admin-input--error,
  .admin-select--error,
  .admin-textarea--error {
    border-color: var(--alertRedColor);
    background: #fff5f2;
  }
  .admin-form-hint {
    font-size: 14px;
    color: var(--greys400Color);
    margin-top: 8px;
    line-height: 150%;
  }
  .admin-form-error {
    font-size: 14px;
    color: var(--alertRedColor);
    margin-top: 8px;
  }
  .admin-filter {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
  }
  .admin-filter .admin-label { margin-bottom: 0; }
  .admin-filter .admin-select { width: auto; min-width: 160px; }

  /* ----- Tables ----- */
  .admin-table-wrap { overflow-x: auto; }
  .admin-card:not(.admin-card--table) .admin-table-wrap {
    border-radius: 8px;
    border: 1px solid var(--greysColor);
  }
  .admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 150%;
  }
  .admin-table th {
    text-align: left;
    padding: 14px 24px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primaryColor);
    background: var(--silkWhiteColor);
    border-bottom: 1px solid var(--greysColor);
    white-space: nowrap;
  }
  .admin-card--table .admin-table th {
    padding: 13px 24px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--greys500Color);
    background: var(--greys100Color);
    border-bottom: 1px solid var(--greysColor);
  }
  .admin-card--table .admin-table th:first-child { padding-left: 28px; }
  .admin-card--table .admin-table th:last-child { padding-right: 28px; }
  .admin-table th.admin-col-center,
  .admin-table td.admin-col-center { text-align: center; }
  .admin-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--greysColor);
    vertical-align: middle;
    color: var(--sootBlackColor);
  }
  .admin-card--table .admin-table td {
    padding: 18px 24px;
    border-bottom: 1px solid var(--greysColor);
  }
  .admin-card--table .admin-table td:first-child { padding-left: 28px; }
  .admin-card--table .admin-table td:last-child { padding-right: 28px; }
  .admin-table tbody tr {
    transition: background var(--admin-transition);
  }
  .admin-table--hover tbody tr:hover,
  .admin-table tbody tr:hover {
    background: var(--greys100Color);
  }
  .admin-card--table .admin-table tbody tr:hover {
    background: var(--greys100Color);
  }
  .admin-table tbody tr:last-child td { border-bottom: none; }
  .admin-table a {
    color: var(--primaryColor);
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    line-height: 135%;
    transition: color var(--admin-transition);
  }
  .admin-table a:hover {
    color: var(--primary300Color);
    text-decoration: underline;
  }
  .admin-table .admin-money {
    font-weight: 600;
    color: var(--primaryColor);
  }
  .admin-table .admin-date {
    color: var(--greys400Color);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .admin-email-cell {
    color: var(--greys500Color);
    font-size: 16px;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .admin-folder-name-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 14rem;
  }
  .admin-card--table .admin-folder-name-cell {
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .admin-folder-name-cell > a {
    font-size: 16px;
    line-height: 150%;
    color: var(--primaryColor);
    font-weight: 600;
  }
  .admin-folder-name-cell > a:hover {
    color: var(--primary300Color);
    text-decoration: underline;
  }
  .admin-product-cell {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .admin-product-cell img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--greysColor);
  }
  .admin-product-name {
    font-size: 16px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
    color: var(--sootBlackColor);
  }

  /* ----- Pills / badges ----- */
  .admin-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    line-height: 150%;
    font-variant-numeric: tabular-nums;
    border: 1px solid transparent;
  }
  .admin-pill--draft {
    background: var(--primary100Color);
    color: var(--primary400Color);
    border-color: var(--primary200Color);
  }
  .admin-pill--in_progress {
    background: var(--primary100Color);
    color: var(--primaryColor);
    border-color: var(--primary200Color);
  }
  .admin-pill--awaiting_customer,
  .admin-pill--finalized {
    background: var(--primary100Color);
    color: var(--primaryColor);
    border-color: var(--primary200Color);
  }
  .admin-pill--ordered {
    background: var(--greys100Color);
    color: var(--greys500Color);
    border-color: var(--greysColor);
  }
  .admin-pill--archived {
    background: #fff5f2;
    color: var(--alertRedColor);
    border-color: #f5c4b8;
  }

  /* ----- Empty state ----- */
  .admin-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--greys400Color);
    font-size: 16px;
    line-height: 150%;
  }
  .admin-empty p { margin: 0; }
  .admin-empty > p:first-of-type {
    font-size: 18px;
    font-weight: 600;
    line-height: 135%;
    color: var(--primaryColor);
    font-family: var(--font-stack-header);
  }
  .admin-empty--icon .admin-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 8px;
    background: var(--silkWhiteColor);
    border: 1px solid var(--primary200Color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary300Color);
    font-size: 1.5rem;
    line-height: 1;
  }
  .admin-empty--icon .admin-empty-icon::before {
    content: '▣';
    opacity: 0.85;
  }
  .admin-empty-hint {
    margin-top: 8px !important;
    font-size: 16px;
    color: var(--greys400Color);
    max-width: 420px;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Product hero (detail page) */
  .admin-product-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--silkWhiteColor);
    border: 1px solid var(--greysColor);
    border-radius: 8px;
    margin-bottom: 24px;
  }
  .admin-product-hero img {
    width: 84px;
    height: 84px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--greysColor);
  }
  .admin-product-hero .admin-product-title {
    font-family: var(--font-stack-header);
    font-weight: 400;
    font-size: 24px;
    line-height: 135%;
    margin: 0 0 4px 0;
    color: var(--primaryColor);
  }
  .admin-product-hero .admin-product-meta {
    font-size: 16px;
    line-height: 150%;
    color: var(--greys400Color);
    margin: 0;
  }
  .admin-option-row {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--primary100Color);
  }
  .admin-option-row:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
  .admin-option-row.admin-hidden { display: none !important; }
  .admin-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 0;
  }
  .admin-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    font-size: 16px;
    cursor: pointer;
    user-select: none;
    padding-left: 28px;
    position: relative;
    min-height: 20px;
    color: var(--primaryColor);
  }
  .admin-checkbox-label input {
    position: absolute;
    left: 0;
    opacity: 0;
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
  }
  .admin-checkbox-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary300Color);
    border-radius: 4px;
    background: var(--silkWhiteColor);
    transition: border-color var(--admin-transition), background var(--admin-transition);
  }
  .admin-checkbox-label:hover::before { border-color: var(--primaryColor); }
  .admin-checkbox-label:has(input:checked)::before {
    background: var(--primaryColor);
    border-color: var(--primaryColor);
  }
  .admin-checkbox-label:has(input:checked)::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 50%;
    transform: translateY(-58%) rotate(45deg);
    width: 5px;
    height: 10px;
    border: solid var(--silkWhiteColor);
    border-width: 0 2px 2px 0;
  }
  .admin-radio-label { display: inline-flex; align-items: center; gap: 8px; }
  .admin-radio-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    vertical-align: middle;
  }

  /* ----- Page layout variants ----- */
  .admin-wrap--narrow { max-width: 100%; }
  .admin-contact-panel-block { margin-bottom: 24px; }
  .admin-actions { margin-bottom: 20px; }
  .admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--silkWhiteColor);
    border: 1px solid var(--greysColor);
    border-radius: 8px;
    margin-bottom: 16px;
  }
  .folder-actions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--greys100Color);
    border-bottom: 1px solid var(--greysColor);
  }
  .admin-card--table > .folder-actions-bar:first-child {
    border-radius: 8px 8px 0 0;
  }
  .folder-actions-bar.is-submitting {
    opacity: 0.92;
    pointer-events: none;
  }

  /* HubSpot quote button */
  .admin-btn--hubspot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 20px;
    border: 1px solid #ff7a59;
    border-radius: 8px;
    background: #ff7a59;
    color: var(--silkWhiteColor);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    width: fit-content;
    transition: background var(--admin-transition), border-color var(--admin-transition);
  }
  .admin-btn--hubspot:hover:not(:disabled) {
    background: #ff5c35;
    border-color: #ff5c35;
  }
  .admin-btn--hubspot:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
  .admin-btn--hubspot .admin-btn__icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
  }
  .admin-btn--hubspot .admin-btn__text {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
  }
  .admin-btn--hubspot .admin-btn__subtitle {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.9;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .admin-btn--hubspot.is-loading {
    cursor: wait;
    pointer-events: none;
  }
  .admin-btn--hubspot.is-loading .admin-btn__icon--mail { display: none; }
  .admin-btn--hubspot .admin-btn__icon--spinner {
    display: none;
    animation: admin-hubspot-btn-spin 0.7s linear infinite;
  }
  .admin-btn--hubspot.is-loading .admin-btn__icon--spinner { display: block; }
  .admin-btn--hubspot.is-loading .admin-btn__subtitle { display: none; }
  @keyframes admin-hubspot-btn-spin { to { transform: rotate(360deg); } }

  /* Folder detail table extras */
  .admin-product-cell-block { min-width: 220px; }
  .admin-config-options-preview { margin-top: 6px; }
  .admin-config-options-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary300Color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.3;
  }
  .admin-config-options-toggle:hover {
    color: var(--primaryColor);
  }
  .admin-config-options-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid var(--greysColor);
    border-radius: 4px;
    background: var(--greys100Color);
    font-size: 14px;
    font-weight: 700;
    color: var(--greys500Color);
    flex: 0 0 auto;
  }
  .admin-config-options-list {
    margin: 6px 0 0;
    padding: 8px 12px;
    list-style: none;
    background: var(--greys100Color);
    border: 1px solid var(--greysColor);
    border-radius: 8px;
    max-width: 360px;
  }
  .admin-config-options-list li {
    font-size: 13px;
    line-height: 1.45;
    color: var(--greys500Color);
    padding: 4px 0;
  }
  .admin-config-options-list li + li { border-top: 1px solid var(--greysColor); }
  .admin-config-options-list strong {
    color: var(--sootBlackColor);
    font-weight: 600;
  }
  .admin-table-col-select {
    width: 44px;
    text-align: center;
    vertical-align: middle;
  }
  .admin-table-col-select input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primaryColor);
  }
  .admin-table-select-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    cursor: pointer;
  }
  .admin-table-col-delete {
    width: 52px;
    text-align: center;
    vertical-align: middle;
  }
  .admin-delete-form { margin: 0; display: inline-block; }
  .admin-icon-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: var(--alertRedColor);
    color: var(--silkWhiteColor);
    cursor: pointer;
    transition: background var(--admin-transition);
  }
  .admin-icon-delete:hover { background: #a32200; }
  .admin-icon-delete svg { width: 16px; height: 16px; display: block; }
  .admin-table--compact th,
  .admin-table--compact td { padding: 10px 16px; font-size: 14px; }
  .admin-table--compact th { font-size: 11px; }

  /* Configuration detail form */
  .admin-detail .admin-label { margin-bottom: 8px; }
  .admin-option-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
  }
  .admin-option-label-row .admin-label { margin-bottom: 0; flex: 1 1 auto; }
  .admin-option-selected-price {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary400Color);
    white-space: nowrap;
  }
  .admin-option-selected-price--empty { display: none; }
  .admin-detail .admin-input,
  .admin-detail .admin-select,
  .admin-detail .admin-textarea { margin-bottom: 16px; }
  .admin-detail .admin-section-head {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--greys400Color);
    margin: 24px 0 12px;
    padding-top: 8px;
  }
  .admin-detail .admin-section-head:first-of-type { margin-top: 0; padding-top: 0; }
  .admin-card--form .admin-card-header { background: var(--greys100Color); }
  .admin-card--form { padding: 0; overflow: hidden; }
  .admin-card--form .admin-detail { padding: 24px; }
  .admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--greysColor);
    margin-top: 8px;
  }
  .admin-option-accordion {
    border: 1px solid var(--greysColor);
    border-radius: 8px;
    background: var(--silkWhiteColor);
    margin-bottom: 12px;
    overflow: hidden;
  }
  .admin-option-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--primaryColor);
    cursor: pointer;
    list-style: none;
    background: var(--greys100Color);
    border-bottom: 1px solid transparent;
  }
  .admin-option-accordion[open] > .admin-option-accordion-summary {
    border-bottom-color: var(--greysColor);
  }
  .admin-option-accordion-summary::-webkit-details-marker { display: none; }
  .admin-option-accordion-summary::after {
    content: '+';
    font-size: 18px;
    font-weight: 600;
    color: var(--greys400Color);
    flex: 0 0 auto;
  }
  .admin-option-accordion[open] > .admin-option-accordion-summary::after { content: '−'; }
  .admin-option-accordion-body { padding: 16px 16px 8px; }
  .admin-option-accordion-body .admin-option-row:last-child { margin-bottom: 8px; }
  .admin-choice-cards { display: flex; flex-wrap: wrap; gap: 10px; }
  .admin-choice-card {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--greysColor);
    border-radius: 8px;
    background: var(--silkWhiteColor);
    padding: 10px 12px;
    cursor: pointer;
    min-height: 58px;
    user-select: none;
    transition: border-color var(--admin-transition), box-shadow var(--admin-transition);
  }
  .admin-choice-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  .admin-choice-indicator {
    width: 16px;
    height: 16px;
    border: 2px solid var(--greys300Color);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 16px;
    background: var(--silkWhiteColor);
    color: var(--silkWhiteColor);
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
  }
  .admin-choice-card.admin-choice-card--selected {
    border-color: var(--primary300Color);
    box-shadow: 0 0 0 1px var(--primary200Color) inset;
  }
  .admin-choice-card.admin-choice-card--selected .admin-choice-indicator {
    border-color: var(--primaryColor);
    background: var(--primaryColor);
  }
  .admin-choice-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--greysColor);
    background: var(--greys100Color);
    flex: 0 0 50px;
  }
    .admin-option-row[data-option-id="door_unit_design"] .admin-choice-thumb,
    .admin-option-row[data-option-id="pre_hung"] .admin-choice-thumb,
    .admin-option-row[data-option-id="sidelight_style"] .admin-choice-thumb,
    .admin-option-row[data-option-id="sidelight_location"] .admin-choice-thumb,
    .admin-option-row[data-option-id="transom_style"] .admin-choice-thumb
    {object-fit: contain ;}
  .admin-choice-text {
    font-size: 15px;
    color: var(--sootBlackColor);
    line-height: 1.3;
    font-weight: 500;
  }
  .admin-choice-cards--full {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }
  .admin-choice-cards--full .admin-choice-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 12px;
    min-height: 0;
  }
  .admin-choice-cards--full .admin-choice-thumb {
    width: 100%;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
    background: var(--silkWhiteColor);
    flex: none;
  }
  .admin-choice-cards--full .admin-choice-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
  }
  /* Sidelight style: use standard horizontal choice cards (not full-width grid) */
  .admin-option-row[data-option-id="sidelight_style"] .admin-choice-cards--full {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    grid-template-columns: unset;
  }
  .admin-option-row[data-option-id="sidelight_style"] .admin-choice-cards--full .admin-choice-card {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 10px 12px;
    min-height: 58px;
  }
  .admin-option-row[data-option-id="sidelight_style"] .admin-choice-cards--full .admin-choice-thumb {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    max-height: none;
    aspect-ratio: unset;
    object-fit: contain;
    background: var(--greys100Color);
  }
  .admin-option-row[data-option-id="sidelight_style"] .admin-choice-cards--full .admin-choice-indicator {
    position: static;
    top: auto;
    right: auto;
  }
  
  .admin-option-accordion-body:has(.admin-option-row[data-option-id="measurement_type"]){display:grid;grid-template-columns:1fr 1fr;gap:10px;}
  .admin-option-accordion-body:has(.admin-option-row[data-option-id="measurement_type"]) .admin-select,
  .admin-option-accordion-body:has(.admin-option-row[data-option-id="measurement_type"]) .admin-option-row{margin-bottom:0}
  .admin-option-row[data-option-id="measurement_type"]{grid-column: 1 / span 2;}
  .admin-image-upload-block { margin-bottom: 20px; }
  .admin-image-preview-wrap {
    margin: 8px 0 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .admin-image-preview-item {
    position: relative;
    width: 96px;
    border: 1px solid var(--greysColor);
    border-radius: 8px;
    background: var(--greys100Color);
  }
  .admin-image-preview-item img {
    display: block;
    width: 100%;
    height: 72px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
  }
  .admin-image-preview-item img.admin-image-preview-img--placeholder {
    object-fit: contain;
    background: var(--greys100Color);
    padding: 10px;
    box-sizing: border-box;
  }
  .admin-image-preview-item img.admin-image-preview-img--clickable { cursor: zoom-in; }
  .admin-image-preview-item img.admin-image-preview-img--clickable:hover { opacity: 0.9; }
  .admin-image-preview-caption {
    display: block;
    font-size: 11px;
    color: var(--greys400Color);
    text-align: center;
    padding: 6px;
    margin: 0;
    line-height: 1.25;
  }
  .admin-image-preview-caption.is-done { color: var(--primary400Color); font-weight: 600; }
  .admin-image-preview-caption--pending { color: var(--secondary400Color); font-weight: 600; }
  .admin-image-preview-item--pending {
    border-color: var(--secondary200Color);
    box-shadow: 0 0 0 1px var(--secondary100Color);
  }
  .admin-image-preview-filename {
    display: block;
    font-size: 10px;
    color: var(--greys400Color);
    text-align: center;
    padding: 0 6px 6px;
    margin: 0;
    word-break: break-all;
    line-height: 1.25;
  }
  .admin-image-preview-item a {
    display: block;
    font-size: 11px;
    padding: 6px;
    color: var(--primary300Color);
    word-break: break-all;
    line-height: 1.25;
  }
  .admin-image-preview-item button {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 32, 49, 0.75);
    color: var(--silkWhiteColor);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    z-index:10;
  }
  .admin-image-upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .admin-image-upload-actions input[type="file"] { max-width: 100%; }
  .admin-image-upload-status {
    font-size: 13px;
    color: var(--greys400Color);
    margin-top: 6px;
  }
  .admin-image-upload-status.is-error { color: var(--alertRedColor); }
  .admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
  }
  .admin-summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--greysColor);
    border-radius: 8px;
    background: var(--silkWhiteColor);
    padding: 10px 12px;
  }
  .admin-summary-thumb {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--greysColor);
    background: var(--greys100Color);
    flex: 0 0 54px;
  }
  .admin-summary-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .admin-summary-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--greys400Color);
    font-weight: 600;
  }
  .admin-summary-value {
    font-size: 15px;
    color: var(--sootBlackColor);
    font-weight: 600;
    word-break: break-word;
  }
  .admin-hardware-selections-readonly { margin-top: 4px; }
  .admin-hardware-selections-list {
    margin: 0;
    padding-left: 20px;
    color: var(--greys500Color);
  }
  .admin-hardware-selections-list li { margin-bottom: 6px; }
  .admin-meta-muted { color: var(--greys400Color); font-size: 14px; }
  .admin-status-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    font-size: 14px;
    color: var(--greys500Color);
    margin: 0 0 24px;
  }
  .admin-status-bar strong { color: var(--sootBlackColor); font-weight: 600; }

    .admin-main { padding: 1.5rem 1.25rem 2.5rem; }
    .admin-page-title { font-size: 28px; }
  }
  @media (max-width: 767.98px) {
    .admin-main { padding: 1.25rem 1rem 2rem; }
    .admin-page-title { font-size: 24px; }
    .admin-page-header { margin-bottom: 1.5rem; padding-bottom: 1.25rem; }
    .admin-table th,
    .admin-table td { padding-left: 16px; padding-right: 16px; }
    .admin-folder-name-cell { min-width: 10rem; }
    .admin-sidebar {
      position: fixed;
      left: 0;
      top: 0;
      z-index: 200;
      height: 100vh;
      box-shadow: 2px 0 12px rgba(0, 0, 0, 0.12);
    }
    .admin-sidebar--collapsed {
      width: 0;
      min-width: 0;
      overflow: hidden;
      border-right: none;
      box-shadow: none;
    }
    .admin-main { margin-left: var(--admin-sidebar-width); }
    .admin-sidebar--collapsed + .admin-main { margin-left: 0; }
  }
</style>
