:root {
    --text: #0b1220;           /* primary text on white */
    --muted: #5b6b80;          /* secondary text */
    --brand: #2563eb;          /* blue */
    --brand-2: #27B7C1;        /* teal */
    --accent: #7c3aed;         /* violet */
    --danger: #ef4444;         /* red */
    --success: #16a34a;        /* green */
    --chip: #f5f7fb;           /* chip bg */
    --border: #e5eaf2;         /* light border */
    --shadow: 0 8px 24px rgba(17, 24, 39, .08);
    --radius: 14px;
    --card: #ffffff;           /* card bg on white */
    --row-hover: #e6effd;      /* subtle hover border tint */
    --zebra: #fafbfc;
}

.form-check-input:checked{
    background-color: #49B5E0;
    border-color: #49B5E0
;
}

/* * { box-sizing: border-box; } */
html, body { height: 100%; }
body {
    margin: 0;
    /* font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji"; */
    color: var(--text);
    background: #ffffff; /* White background */
    letter-spacing: .2px;
}

.container { max-width: 1200px; margin: 24px auto 80px; padding: 0 20px; font-size: 12px; }

header.hero { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; margin-bottom: 20px; }
.title { display: flex; align-items: center; gap: 14px; }
.title-logo { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; box-shadow: var(--shadow); }
.title-logo svg { filter: drop-shadow(0 2px 6px rgba(0,0,0,.15)); }
h1 { font-size: 1.6rem; margin: 0; letter-spacing: .3px; }
.sub { color: var(--muted); font-size: .95rem; margin-top: 4px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
/* button, .btn {
    appearance: none; border: 1px solid var(--border); cursor: pointer;
    padding: 10px 14px; border-radius: 10px; font-weight: 600;
    color: var(--text); background: #ffffff; transition: transform .06s ease, box-shadow .2s ease, border-color .2s ease;
    box-shadow: var(--shadow);
} */
/* .btn:hover{
    color: black !important;
} */
/* button:hover { transform: translateY(-1px); border-color: #cbd5e1; } */
/* .btn-secondary { background: #f7fafc; } */
/* .btn-ghost { background: transparent; color: var(--muted); border-style: dashed; } */
/* .btn-success { background: linear-gradient(135deg, #eef2ff, #e6fffa); color: var(--text); } */

/* Single-column layout */
.grid { display: grid; grid-template-columns: 1fr; gap: 18px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card h2 { margin: 0; font-size: 1.1rem; }
.card-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:10px; }
.card-body { padding: 14px 16px; }

.toolbar { display:flex; align-items:center; gap:10px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; background: var(--chip); color: #2e3a49; border: 1px solid var(--border); font-size: .85rem; }

/* Segmented Toggle */
.seg { display:inline-flex; border:1px solid var(--border); border-radius: 999px; overflow:hidden; background: #fff; box-shadow: var(--shadow); }
.seg button { border:none; background:#fff; padding:8px 12px; font-weight:700; color:#334155; cursor:pointer; }
.seg button + button { border-left:1px solid var(--border); }
.seg button.active { background: #eff6ff; color:#1e3a8a; }

/* Cards layout */
.list { display: grid; gap: 12px; }
.product { display: grid; grid-template-columns: 64px 1fr 1fr auto; gap: 12px; align-items: start; padding: 10px; border-radius: 12px; background: #ffffff; border: 1px solid var(--border); cursor: pointer; }
.product:hover { border-color: var(--row-hover); }
.product.selected { outline: 2px solid var(--brand-2); box-shadow: 0 0 0 3px rgba(20,184,166,.15); }

.thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; position: relative; background: #f3f4f6; border:1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .fallback { position:absolute; inset:0; display:grid; place-items:center; color:#64748b; font-weight:700; font-size: .8rem; background: #f8fafc; }

.meta { display: grid; gap: 4px; }
.meta .name { font-weight: 700; }
.meta .desc { color: var(--muted); font-size: .92rem; }
.badges { display:flex; gap:6px; flex-wrap: wrap; }

.select { display:flex; align-items:center; gap:8px; }
input[type="checkbox"] { width: 18px; height: 18px; }

.divider { height:1px; background: var(--border); margin: 14px 0; }

/* Inline attributes in cards */
.attr-inline { grid-column: 1 / -1; margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 10px; }
.attr-inline .section-title { display:flex; align-items:center; gap:10px; margin: 6px 0 8px; color: var(--muted); }
.chips { display:flex; flex-wrap:wrap; gap:8px; }
.chip { background: var(--chip); border: 1px solid var(--border); border-radius: 999px; padding: 6px 9px; font-size: .86rem; display: inline-flex; gap: 8px; align-items: center; color: #1f2937; }
.chip .k { color:#475569; }
.chip .v { color:#111827; font-weight:600; }
.chip.new { outline: 2px solid var(--brand-2); box-shadow: 0 0 0 3px rgba(20,184,166,.15); }
/* .chip.new::after { content: 'NEW'; margin-left: 6px; font-size: .68rem; background: var(--text); color: #07221f; padding: 3px 6px; border-radius: 999px; font-weight: 900; letter-spacing:.4px; } */

/* Table layout */
.table-wrap { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background:#fff; }
thead { background:#f8fafc; border-bottom:1px solid var(--border); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: .93rem; vertical-align: top; }
tbody tr:nth-child(odd) { background: var(--zebra); }
tbody tr:hover { background: #f0f7ff; }
td.select-cell { width: 60px; }
td.thumb-cell { width: 60px; }
.mini-thumb { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; border:1px solid var(--border); background:#f3f4f6; display:grid; place-items:center; }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-thumb .fallback { color:#64748b; font-weight:700; font-size:.8rem; }
.badge { display:inline-block; padding: 4px 8px; border-radius:999px; background:#eef2ff; color:#01445E; font-size:.8rem; border:1px solid #e5e7eb; }

/* Detail rows for table */
.detail-row td { background:#ffffff; }
.detail-content { padding: 10px 6px; border-left: 4px solid var(--brand-2); border-radius: 8px; background:#f8fafc; }
.detail-content .section-title { display:flex; align-items:center; gap:10px; margin: 6px 0 8px; color: var(--muted); }
.summary {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px;
}
.summary .stat {  border:1px solid var(--border); padding: 12px; border-radius: 12px; text-align:center; }
.stat .label { color: var(--muted); font-size:.85rem; }
.stat .value { font-size: 1.25rem; font-weight: 800; }

.empty { color: var(--muted); padding: 6px 0; }



/* Upload: dropzone + status */
.dropzone { border: 2px dashed var(--border); padding: 18px; text-align:center; background:#fafbfc; color:#475569; }
.dropzone.drag { background:#eef6ff; border-color:#93c5fd; }

.file-info { color: var(--muted); font-size:.9rem; }

/* Optional success/error coloring */
#uploadStatus.success { color: #16a34a; }
#uploadStatus.error   { color: #ef4444; }



/* Pagination bar */
.pagination-bar {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.page-size {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: .92rem;
}

.page-size select {
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
}

.pager {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.pager-btn {
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-weight: 600;
  color: var(--text);
}

.pager-btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
}

.page-info {
  color: var(--muted);
  font-weight: 600;
}

/* loader */
#full-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* semi-transparent black */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

.select-attr {
  margin-left: 10px;
  font-size: 0.9em;
  color: #666;
}

/* Make attribute groups display in two columns */
.attribute-selectors {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Two equal columns */
    gap: 10px; /* Space between columns */
    max-width: 800px; /* Optional: Limit max width */
}

/* Make section headers span full width */
.mandatory-title,
.optional-title {
    grid-column: span 2; /* Make them stretch across both columns */
}

/* Make each attribute group fill one column */
.attribute-chip-group {
    width: 100%; /* Ensure full use of column space */
}

/* 
/* General layout */
.attribute-selectors {
    /* font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; */
    max-width: none;
    margin: 5px auto;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    width: max-content;
}

/* Section titles */
.mandatory-title,
.optional-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-bottom: 0px;
    padding-left: 5px;
    border-left: 4px solid #007BFF;
}

/* Attribute group block */
.attribute-chip-group {
    margin-bottom: 15px;
}

/* Attribute headers */
.attribute-header {
    font-size: 1em;
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
}

/* Chips container layout */
.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Individual chip */
.attribute-chip {
    display: inline-flex;
    align-items: center;
    background-color: #f0f4f8;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 2px 10px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    user-select: none;
    font-size: 0.95em;
}

/* Hide the native checkbox */
.attribute-chip input[type="checkbox"] {
    display: none;
}

/* Style span inside chip */
.attribute-chip span {
    color: #333;
}

/* Highlight chip when selected */
.attribute-chip input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #007BFF;
}

/* Add visual feedback for selected chips */
.attribute-chip input[type="checkbox"]:checked + span::before {
    content: "✔ ";
    color: #007BFF;
    margin-right: 4px;
}

/* Hover effect */
.attribute-chip:hover {
    background-color: #e6f0ff;
    border-color: #007BFF;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.2);
}

/* Responsive */
@media (max-width: 600px) {
    .chips-container {
        flex-direction: column;
        gap: 8px;
    }

    .attribute-chip {
        width: 100%;
        justify-content: center;
    }
}


/* MOBILE STYLING */
@media (max-width: 600px) {
    .product {
        grid-template-columns: 48px auto;
        grid-template-rows: auto auto;
        gap: 8px;
        align-items: center;
        padding: 12px;
    }

    .product > :nth-child(2),
    .product > :nth-child(3) {
        grid-column: 2 / span 1;
    }

    .product > :nth-child(4) {
        grid-column: 1 / -1;
        justify-self: end;
        margin-top: 8px;
    }
}

/* @media (max-width: 600px) {
    .attribute-selectors {
        grid-template-columns: 1fr; 
    }

    .chips-container {
        flex-direction: column;
        gap: 8px;
    }

    .attribute-chip {
        width: 100%;
        justify-content: center;
    }
} */

td{
    font-size: 12px;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#thresholdRange {
    width: 150px;
}

/* Optional: style tweaks */
#mandatory-attributes {
    min-width: 200px;
    width: auto !important; /* Override inline style */
}

.select2-container--default .select2-selection--multiple .select2-selection__clear{
    color: red;
}