/* Copied from ELPortal ProductApp/templates/ProductApp/product_manager_live.html and ProductApp/static/ProductApp/css/product_styles.css on 2026-11-19. Keep in sync by re-copying, not by editing here. */

/* === From ProductApp/templates/ProductApp/product_manager_live.html (<style> lines 15-983) === */
  /* Flex stacks for elements toggled by x-show. Bootstrap's d-flex is
     !important and would beat x-show's display:none. */
  .xs-stack { display: flex; flex-direction: column; }
  .xs-stack.gap-1 { gap: .25rem; }
  .xs-stack.gap-3 { gap: 1rem; }
  .media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  /* Product names in the list wrap to at most two lines; full text on hover. */
  .clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  :root {
    --ai-blue: #2563eb;
    --slate-50: #f8fafc;
    --slate-200: #e2e8f0;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-900: #0f172a;
    --border: #e2e8f0;
  }

  /* Custom Scrollbars */
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }

  * {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }

  /* Short left/right toggle switch with fixed dimensions */
  .short-toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    margin-bottom: 0;
    user-select: none;
    padding: 3px 6px;
    border-radius: 6px;
    transition: background 0.15s ease;
  }
  .short-toggle-switch:hover {
    background-color: #f1f5f9;
  }
  .short-toggle-track {
    position: relative;
    display: inline-block;
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 16px !important;
    min-height: 16px !important;
    max-height: 16px !important;
    background-color: #cbd5e1;
    border-radius: 16px;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
  }
  .short-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px !important;
    height: 12px !important;
    background-color: #ffffff;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  }
  .short-toggle-active .short-toggle-track {
    background-color: #2563eb !important;
  }
  .short-toggle-active .short-toggle-knob {
    transform: translateX(12px) !important;
  }

  /* Page Lock */
  .product-page-container {
    height: calc(100vh - 60px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  /* Keeps x-show elements (e.g. the search spinner) hidden until Alpine boots. */
  [x-cloak] {
    display: none !important;
  }

  /* Dashboard */
  .pim-search {
    max-width: 360px;
  }

  /* Single-line by default; autoGrowSearch() stretches it up to 180px on paste. */
  .pim-search-box {
    font-size: 13px;
    line-height: 20px;
    height: 38px;
    min-height: 38px;
    max-height: 180px;
    padding-top: 8px;
    padding-bottom: 8px;
    resize: none;
    overflow-y: auto;
  }

  /* Search/loading button. Keeps its icon at the top as the box grows. */
  .pim-search-btn {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10px 12px 0 12px;
    width: 40px;
    border-color: var(--slate-200);
  }

  .pim-search-btn:disabled {
    opacity: 1;
    background: #fff;
  }

  /* Page jump box: a number input without the spinner arrows. */
  .page-jump-input {
    width: 58px;
    padding: 2px 6px;
    text-align: center;
    font-weight: 600;
    color: var(--slate-600);
    border-color: var(--slate-200);
    border-radius: 6px;
    -moz-appearance: textfield;
  }

  .page-jump-input::-webkit-outer-spin-button,
  .page-jump-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  /* Keep the pager centred on wide screens while the rows-per-page control
     sits on the left; on narrow screens it just wraps into the flex row. */
  @media (min-width: 992px) {
    .pagination-rows {
      position: absolute;
      left: 24px;
    }
  }

  /* Product list Inventory cell: total, split bar, legend. */
  .inv-cell { min-width: 96px; max-width: 150px; }
  .inv-total { font-size: 13px; font-weight: 700; color: var(--slate-900); line-height: 1.2; white-space: nowrap; }
  .inv-total small { font-size: 10px; font-weight: 500; color: var(--slate-400); margin-left: 3px; }
  .inv-bar { display: flex; height: 4px; border-radius: 2px; overflow: hidden; background: var(--slate-200); margin: 5px 0 4px; }
  .inv-bar > span { display: block; height: 100%; min-width: 3px; }
  .inv-legend { display: flex; flex-wrap: wrap; column-gap: 8px; row-gap: 1px; font-size: 10.5px; color: var(--slate-500); line-height: 1.4; }
  .inv-legend > span { white-space: nowrap; }
  .inv-legend i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 3px; vertical-align: 1px; }
  .inv-legend b { font-weight: 600; color: var(--slate-600); }
  .inv-out { display: inline-block; white-space: nowrap; font-size: 10.5px; font-weight: 600; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 4px; padding: 1px 6px; }
  .type-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    color: var(--slate-600);
    display: inline-block;
    white-space: nowrap;
    border: 1px solid var(--slate-200);
  }

  .badge-active {
    background: #f1f5f2;
    color: #4a6741;
    border: 1px solid #d1dbd1;
  }

  .readiness-bar {
    height: 5px;
    border-radius: 3px;
    background: var(--slate-200);
  }

  .readiness-fill {
    height: 5px;
    border-radius: 3px;
    background: var(--ai-blue);
  }

  .product-row {
    cursor: pointer;
    transition: background .15s;
  }

  .product-row:hover {
    background: #f0f7ff;
  }

  .detail-header {
    background: #fff;
    border-bottom: 1px solid var(--slate-200);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
  }

  .detail-body {
    flex: 1;
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    overflow: hidden;
    min-height: 0;
  }

  .detail-col {
    border-right: 1px solid var(--slate-200);
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
    min-width: 0;
  }

  .detail-col:last-child {
    border-right: none;
  }

  /* Tablets / narrow windows: an open product fills the screen (the list is
     hidden behind it) and the two detail columns stack and scroll together. */
  @media (max-width: 1199.98px) {
    .detail-body { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .detail-col { border-right: none; overflow: visible; }
    /* .detail-body scrolls here and has no padding, so pin flush at 0. */
    .detail-body .detail-col > .pim-tabs { top: 0; }
  }

  /* Component Tree */
  .tree-node {
    font-size: 12px;
  }

  .tree-toggle {
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--slate-900);
  }

  .tree-toggle:hover {
    color: var(--ai-blue);
  }

  .tree-children {
    padding-left: 12px;
    border-left: 1px solid var(--slate-200);
    margin-left: 6px;
  }

  .tree-leaf {
    padding: 4px 6px;
    font-size: 11px;
    color: var(--slate-600);
    display: flex;
    align-items: flex-start;
    gap: 6px;
  }

  .tree-qty {
    font-weight: 700;
    color: var(--slate-900);
    background: var(--slate-200);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 10px;
  }

  /* Asset Gallery Overhaul */
  .asset-container {
    height: 350px;
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
  }

  .asset-hero-wrap {
    width: 66.66%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    position: relative;
  }

  .asset-hero-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .asset-grid-wrap {
    width: 33.33%;
    height: 100%;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-content: start;
    gap: 10px;
    padding-right: 4px;
  }

  .asset-thumb-card {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--slate-200);
    cursor: pointer;
    aspect-ratio: 1/1;
    width: 100%;
  }

  .asset-thumb-card.active {
    border-color: var(--ai-blue);
  }

  .asset-thumb-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .asset-thumb-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    font-size: 9px;
    padding: 2px 0;
    text-transform: uppercase;
    font-weight: 700;
    text-align: center;
  }

  /* Badges */
  .badge-kit {
    background: #dcfce7;
    color: #166534;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    border: 1px solid #bbf7d0;
    text-transform: uppercase;
  }

  .badge-comp {
    background: #f1f5f9;
    color: #475569;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    border: 1px solid #e2e8f0;
    text-transform: uppercase;
  }

  /* Tabs */
  /* Pinned to the top of the scrolling column so Content / Media / Change Log
     stay reachable after scrolling down a long tab. The negative margins and
     matching padding stretch the bar over the column's 20px padding, so
     content scrolling underneath is fully covered. top is -20px because sticky
     pins inside the scroll container's padding, which would leave a 20px gap
     above the bar for content to show through. */
  .detail-col > .pim-tabs {
    position: sticky;
    top: -20px;
    z-index: 5;
    background: #f8fafc;
    margin: -20px -20px 0;
    padding: 0 20px;
  }

  .pim-tabs .nav-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--slate-600);
    padding: 12px 16px;
    border: none;
    border-bottom: 3px solid transparent;
    background: none;
  }

  .pim-tabs .nav-link.active {
    color: var(--ai-blue);
    border-bottom-color: var(--ai-blue);
  }

  /* Data Section Cards */
  .data-section-card {
    margin-bottom: 24px;
  }

  .data-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* Attrs table */
  .attr-table {
    width: 100% !important;
    font-size: 13px;
    border-collapse: separate;
    border-spacing: 0;
  }

  .attr-row {
    border-bottom: 1px solid var(--slate-50);
  }

  .attr-row td {
    padding: 12px 0;
  }

  .attr-label {
    color: var(--slate-500);
    width: 150px;
    vertical-align: top;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.3px;
  }

  .attr-value {
    color: var(--slate-900);
    font-weight: 600;
    font-size: 14px;
  }


  .feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: var(--slate-600);
  }

  .feature-list li {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .feature-list li::before {
    content: "•";
    color: var(--ai-blue);
    font-weight: 900;
  }

  /* Audit log */
  .audit-item {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--slate-200);
  }

  .audit-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ai-blue);
    flex-shrink: 0;
    margin-top: 5px;
  }

  .audit-text {
    font-size: 12px;
    color: var(--slate-900);
    font-weight: 500;
  }

  .audit-time {
    font-size: 10px;
    color: var(--slate-500);
  }

  /* Right column widgets */
  .widget-card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
  }

  .widget-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--slate-400);
    margin-bottom: 12px;
  }

  .detail-body .card,
  .detail-body .card-body,
  .detail-body .feature-list,
  .detail-body table {
    width: 100% !important;
  }

  /* Chevron Rotation */
  .chevron-icon {
    transition: transform 0.2s ease;
  }
  .rotate-180 {
    transform: rotate(180deg);
  }

/* === From ProductApp/static/ProductApp/css/product_styles.css (lines 1-27, 247-337, 367-388, 409-450, 485-532, 552-561) === */
/* -------------------------------
   Root Design Tokens
-------------------------------- */
:root {
    --color-bg: #f9fafb;
    --color-surface: #ffffff;
    --color-border: #e5e7eb;
    --color-text: #111827;
    --color-text-muted: #6b7280;

    --color-primary: #2563eb;  /* blue-600 */
    --color-primary-hover: #1e4ed8;
    --color-success: #10b981;  /* green-500 */
    --color-error: #ef4444;    /* red-500 */
    --color-warning: #f59e0b;  /* amber-500 */

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 6px rgba(0,0,0,0.08);
    --shadow-lg: 0 6px 24px rgba(0,0,0,0.12);

    --transition: all 0.25s ease;
    --font-base: 'Inter', -apple-system, "Segoe UI", Roboto, Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
}
/* -------------------------------
   Product Catalog Table
-------------------------------- */
.product-catalog-list {
    margin-top: 1rem;
    overflow-x: auto;
}
.product-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}
.product-table th,
.product-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
.product-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.03em;
}
.product-table tbody tr:nth-child(even) {
    background: #fdfdfd;
}
.product-table tbody tr:hover {
    background: #f3f4f6;
}
.product-thumb {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #f1f3f5;
}

/* -------------------------------
   Cards / Info blocks
-------------------------------- */
.tab-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.info-card {
    background: #f9fafb;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
}
.info-card .label {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}
.info-card .value {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

/* -------------------------------
   Logs
-------------------------------- */
.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 1rem;
}
.logs-table th,
.logs-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
}
.logs-table th {
    background: #f3f4f6;
    font-weight: 600;
    color: #374151;
}
/* -------------------------------
   Pagination
-------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}
.pagination button {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--color-border);
    background: #f9fafb;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
}
.pagination button:hover {
    background: #f3f4f6;
}

/* -------------------------------
   Redesigned Section
-------------------------------- */
.redesigned-section {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(37,99,235,0.04), 0 1.5px 4px rgba(0,0,0,0.03);
    border: 1.5px solid #e5e7eb;
    margin-bottom: 2.5rem;
    padding: 0;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f5f7fa;
    padding: 1.25rem 1.5rem 0.75rem 1.5rem;
}

.section-icon {
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0.01em;
}

.section-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0 1.5rem;
}
.pim-details {
  padding: 2rem 0 0 0;
  background: none;
}

.pim-section {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(37,99,235,0.06), 0 1.5px 4px rgba(0,0,0,0.03);
  margin-bottom: 2.5rem;
  padding: 0 0 1.5rem 0;
}

.pim-section-header {
  padding: 1.5rem 2rem 0.5rem 2rem;
  background: none;
}

.pim-section-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #222;
  letter-spacing: 0.01em;
}

.pim-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem 2.5rem;
  padding: 0 2rem;
}

.pim-field {
  display: flex;
  flex-direction: column;
  background: none;
  border-radius: 12px;
  padding: 0.5rem 0 0.5rem 0;
  box-shadow: none;
}

.pim-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
}
@media (max-width: 900px) {
  .pim-fields {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    padding: 0 1rem;
  }
  .pim-section-header {
    padding: 1.2rem 1rem 0.5rem 1rem;
  }
}
