/* ============================================================
   FEATURES 1-9 — NEW COMPONENT STYLES
   ============================================================ */

/* ── Secondary / CSV action button ── */
.btn-secondary-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text2);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-secondary-action:hover {
    background: var(--surface3);
    border-color: var(--teal);
    color: var(--teal-d);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ── Feature 1: Category badge in product table ── */
.prod-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, var(--violet-pale), #ede9fe);
    color: var(--violet);
    border: 1px solid rgba(124, 58, 237, 0.15);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2em 0.65em;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

/* ── Feature 1: Category group header in PDF ── */
.pdf-category-header {
    background: linear-gradient(90deg, var(--teal-pale2), var(--teal-pale));
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--teal-d);
    padding: 0.6rem 1rem;
    border-top: 2px solid rgba(13, 148, 136, 0.2);
    border-bottom: 1px solid rgba(13, 148, 136, 0.1);
}

/* ── Feature 1: Category filter datalist ── */
#productCategoryFilter {
    min-width: 160px;
}

/* ── Feature 2: Slab Pricing rows ── */
.slab-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: linear-gradient(145deg, #fffbeb, #fef9ee);
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.slab-row input {
    flex: 1;
}

.making-charge-toggle {
    display: inline-flex;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    vertical-align: middle;
}

.slab-type-toggle {
    display: inline-flex;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 2px;
}

.slab-type-btn {
    background: #f9fafb;
    border: none;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.slab-type-btn:first-child {
    border-right: 1px solid #d1d5db;
}

.slab-type-btn.active {
    background: linear-gradient(135deg, #0d9488, #0891b2);
    color: #fff;
}

.slab-type-btn:hover:not(.active) {
    background: #e5e7eb;
}

/* ── Feature 3: Auto-recalculation alert banner ── */
.recalculation-alert {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fcd34d;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: shake 0.5s ease;
}

.recalculation-alert .alert-icon {
    font-size: 1.2rem;
    color: #d97706;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.recalculation-alert .alert-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #92400e;
    margin-bottom: 0.25rem;
}

.recalculation-alert .alert-body {
    font-size: 0.78rem;
    color: #78350f;
    line-height: 1.6;
}

.recalculation-alert .alert-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1rem;
    color: #b45309;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

/* ── Feature 4: Stamp / Signature upload boxes ── */
.sig-upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 2px dashed var(--border2);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    min-height: 110px;
    background: var(--surface3);
    font-size: 0.78rem;
    color: var(--text3);
    font-weight: 600;
}

.sig-upload-box:hover {
    border-color: var(--violet);
    background: var(--violet-pale);
    color: var(--violet-d);
}

.sig-upload-box span {
    font-size: 0.73rem;
    color: var(--text3);
}

/* ── Feature 4: Signature strip in PDF ── */
.pdf-sig-strip {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
}

.pdf-sig-block {
    text-align: center;
}

.pdf-sig-block img {
    max-height: 56px;
    max-width: 130px;
    object-fit: contain;
    display: block;
    margin: 0 auto 4px;
}

.pdf-sig-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-top: 1px solid var(--text3);
    padding-top: 4px;
    margin-top: 4px;
}

/* ── Feature 6: MRP badge in product card ── */
.mrp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, #fdf2f8, #fce7f3);
    color: #be185d;
    border: 1px solid #fbcfe8;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.2em 0.65em;
    border-radius: 20px;
}

.mrp-strike {
    text-decoration: line-through;
    color: var(--text3);
    font-size: 0.8em;
}

/* ── Feature 7: Team tab section ── */
.team-role-badge {
    display: inline-block;
    padding: 0.2em 0.75em;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.team-role-badge.owner {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.team-role-badge.admin {
    background: linear-gradient(135deg, #fdf2f8, #fce7f3);
    color: #be185d;
    border: 1px solid #fbcfe8;
}

.team-role-badge.manager {
    background: linear-gradient(135deg, var(--violet-pale), #ede9fe);
    color: var(--violet-d);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.team-role-badge.salesman {
    background: var(--teal-pale);
    color: var(--teal-d);
    border: 1px solid var(--teal-pale2);
}

/* ── Feature 8: Analytics views column ── */
.views-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.views-stat .views-n {
    color: var(--teal-d);
}

.views-stat .views-label {
    color: var(--text3);
    font-size: 0.7rem;
    font-weight: 600;
}

.views-last {
    display: block;
    font-size: 0.68rem;
    color: var(--text3);
    margin-top: 2px;
}

/* ── Feature 9: Quotation Builder toolbar ── */
.gen-quotation-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: linear-gradient(145deg, var(--surface), var(--surface2));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.875rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.gen-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border: 1.5px solid var(--border2);
    border-radius: 20px;
    background: var(--surface3);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text2);
    cursor: pointer;
    transition: var(--transition);
}

.gen-mode-btn:hover {
    border-color: var(--teal);
    color: var(--teal-d);
    background: var(--teal-pale);
}

.gen-mode-btn.active {
    background: linear-gradient(135deg, var(--teal), var(--teal-d));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.3);
}

.gen-sel-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--teal-d);
    background: var(--teal-pale);
    border: 1px solid var(--teal-pale2);
    padding: 0.2em 0.75em;
    border-radius: 20px;
}

.gen-tpl-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border: 1.5px solid var(--border2);
    border-radius: 20px;
    background: var(--surface3);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text2);
    cursor: pointer;
    transition: var(--transition);
}

.gen-tpl-btn:hover {
    background: var(--violet-pale);
    border-color: var(--violet);
    color: var(--violet-d);
}

.gen-product-selector {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    animation: slide-down 0.25s ease;
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gen-checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    max-height: 260px;
    overflow-y: auto;
}

.gen-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface3);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text2);
    cursor: pointer;
    transition: border-color 0.15s;
}

.gen-checkbox-item:has(input:checked) {
    border-color: var(--teal);
    background: var(--teal-pale);
    color: var(--teal-d);
}

.gen-checkbox-item input[type="checkbox"] {
    accent-color: var(--teal);
}


