/* --- Global & Typography --- */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fade animation for sections */
.fade {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Toast / Message Box --- */
/* Must stay above modal overlays (z-index: 10000) on all devices */
#message-box {
    z-index: 99999 !important;
}

/* On mobile, push toast below the fixed 60px header so it doesn't cover it */
@media (max-width: 768px) {
    #message-box {
        top: 72px !important; /* 60px header + 12px gap */
        right: 1rem !important;
        left: 1rem !important;
        width: auto !important;
    }
}


/*
 * Single-scroller layout (desktop):
 *   - html/body scroll naturally (one scrollbar on the right edge of the window)
 *   - sidebar is sticky at top-0 with height:100vh so it always fills the viewport
 *   - align-self:flex-start prevents the sidebar from stretching to match main's
 *     full height, which is the key that lets the flex row grow beyond 100vh
 *   - main has overflow:visible so it never spawns its own scrollbar
 */
.sidebar-format {
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.08);
    width: 256px;
    min-width: 256px;
    height: 100vh;
    max-height: 100vh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: flex-start; /* key: don't stretch to match main's growing height */
    overflow-y: auto;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.16);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    flex-shrink: 0;
    padding-bottom: 1rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.sidebar-nav button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 1.1rem;
    background: transparent;
    border: 1px solid transparent;
    color: #475569;
    font-weight: 500;
    text-align: left;
    position: relative;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.sidebar-nav button i {
    color: inherit;
    transition: color 0.2s ease;
}

.sidebar-nav button:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #3730a3;
    transform: translateX(2px);
    box-shadow: 0 14px 30px rgba(99, 102, 241, 0.08);
}

.sidebar-nav button.tab-active {
    background: #581c87; /* royal purple 2x darker (purple-900) */
    color: #ffffff;
    font-weight: 700;
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(88, 28, 135, 0.45);
}




.sidebar-footer {
    flex-shrink: 0;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* Nav item group: relative container so + can be placed inside */
.nav-item-group {
    display: block;
    position: relative;
}

.nav-item-group > button[data-tab] {
    width: 100%;
    padding-right: 2.2rem !important; /* make room for the + on the right */
}

/* Quick-add (+) button — lives inside the nav button area, right-aligned */
.sidebar-nav .nav-quick-add-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 22px !important;
    min-width: 22px !important;
    height: 22px !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    line-height: 1 !important;
    box-shadow: none !important;
    gap: 0 !important;
    transition: color 0.18s ease, transform 0.18s ease !important;
}

.sidebar-nav .nav-quick-add-btn:hover {
    background: transparent !important;
    border: none !important;
    color: #a855f7 !important;
    box-shadow: none !important;
    transform: translateY(-50%) scale(1.25) !important;
}

.sidebar-nav .nav-quick-add-btn:active {
    transform: translateY(-50%) scale(0.88) !important;
    color: #9333ea !important;
}

/* White + button when the parent nav-item-group has the active nav button */
.sidebar-nav .nav-item-group:has(button.tab-active) .nav-quick-add-btn {
    color: rgba(255, 255, 255, 0.85) !important;
}

.sidebar-nav .nav-item-group:has(button.tab-active) .nav-quick-add-btn:hover {
    color: #ffffff !important;
}

/* Custom scrollbar for sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(243, 244, 246, 0.5);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

/* --- Single-Scroller Layout (desktop) ---
 * On desktop the browser window is the ONE scroller.
 * main must NOT have overflow-y:auto (removed from HTML class list).
 */
@media (min-width: 769px) {
    html {
        overflow-y: scroll; /* always reserve scrollbar space to prevent layout shift */
    }
    body {
        overflow-y: visible;
    }
    main {
        overflow: visible;
        min-width: 0;
    }
}

/* --- Form Elements --- */
.form-input, .form-select, .form-file-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #374151;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(209, 213, 219, 0.5);
    border-radius: 0.75rem;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Hide number input spinners (up/down arrows) */
input[type="number"].form-input::-webkit-outer-spin-button,
input[type="number"].form-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"].form-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* New styles for the Role Name field */
#role-name {
    width: 100%; /* Full width */
}

/* New styles for the permissions container */
#permissions-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Responsive grid */
    gap: 1rem; /* Space between checkboxes */
}

.form-input:focus, .form-select:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: #9333ea;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1), 0 4px 12px rgba(147, 51, 234, 0.15);
    background-color: rgba(255, 255, 255, 0.95);
}

.form-checkbox {
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    cursor: pointer;
}

/* App Content Visibility */
.app-content.hidden {
  display: none !important;
}

.app-content {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0.75); /* gray-900 with 75% opacity */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000; /* above sidebar toggle button (z-9999) */
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}


.modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 48rem;
    width: 90%;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    transform: scale(1);
    transition: transform 0.3s ease-in-out;
}

.modal-content-lg {
    background-color: #fff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 64rem;
    width: 95%;
    transform: scale(1);
    transition: transform 0.3s ease-in-out;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-overlay.hidden .modal-content, .modal-overlay.hidden .modal-content-lg {
    transform: scale(0.95);
}

body.modal-open {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Scrollable products/materials sections in Sales & Purchase modals */
.modal-content form .border.border-gray-200.rounded-lg.p-4.bg-gray-50 {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Custom scrollbar for modal scrollable sections */
.modal-content form .border::-webkit-scrollbar {
    width: 6px;
}

.modal-content form .border::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.modal-content form .border::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.modal-content form .border::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Ensure modal content doesn't exceed viewport */
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- Table Styles --- */
.table-cell-actions {
    min-width: 120px;
}

/* --- P&L Month Selector Dropdown Styles --- */
#pnl-month-selector {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #374151;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
    /* Use native select appearance - no custom background images */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Add down arrow indicator using CSS */
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 0.75rem center no-repeat;
    background-size: 16px;
}

#pnl-month-selector:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: #9333ea;
    box-shadow: 0 0 0 1px #9333ea;
}

#pnl-month-selector:hover {
    border-color: #9ca3af;
}

/* Ensure options are visible - browser native dropdown */
#pnl-month-selector option {
    padding: 0.5rem;
    background-color: #fff;
    color: #374151;
}

/* --- Sales Trend Custom Date Range: hide native date text inputs, show only calendar icon --- */
#sales-custom-range .sales-range-input {
    /* Visually hidden but keep it selectable.
       Some browsers refuse to open native pickers when pointer-events: none.
       We still hide it using opacity/size, but allow events via the click handler.
    */
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: auto;
    top: 0;
    left: 0;
}



/* Keep the calendar icon button visible */
#sales-custom-range .calendar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Ensure clicking the icon still works even though inputs are visually hidden */
#sales-custom-range {
    position: relative;
    z-index: 1;
}

/* --- Sales Additional Materials dropdown positioning (fix "far below") --- */
/* The additional material autocomplete results are absolutely positioned.
   Ensure they overlay correctly above modal content and align relative to the
   input wrapper (which is .relative in JS-generated markup). */
#additional-materials-container [id^="additional-material-search-results-"] {
    z-index: 9999;
}

/* If any parent has overflow hidden (modal scroll areas), keep dropdown usable. */
#additional-materials-container {
    overflow: visible;
}

/* Ensure results themselves render above everything */
#sale-modal [id^="additional-material-search-results-"] {
    position: absolute;
    z-index: 99999;
}

/* Ensure inputs inside Add Material and Add BOM forms take up full width and don't collapse */
#materials-container .form-input,
#bom-materials-container .form-input {
    width: 100% !important;
    min-width: 0 !important;
}

/* Ensure the Material Name column gets flex growth and generous minimum width on desktop for both row and header */
@media (min-width: 768px) {
    #materials-container > div[id^="material-row-"] > div:first-child,
    #bom-materials-container > div[id^="bom-row-"] > div:first-child,
    .material-col-header > div:first-child,
    .bom-col-header > div:first-child {
        flex: 1 1 0% !important;
        min-width: 250px !important;
    }
}




/* Overrides for inventory buttons when Tailwind output lacks these utilities */
.inventory-add-btn {
    background: linear-gradient(90deg, #7c3aed 0%, #6d28d9 100%);
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.15);
    transition: background 0.18s ease, transform 0.18s ease;
}
.inventory-add-btn:hover {
    background: linear-gradient(90deg, #6d28d9 0%, #5b21b6 100%);
    transform: translateY(-1px);
}

.save-materials-btn {
    background-color: #6b21a8; /* purple-600 */
    color: #ffffff;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.save-materials-btn:hover {
    background-color: #581c87; /* purple-700 */
    transform: translateY(-1px);
}

/* --- Sales Form Mode Toggle Switch (3-tab: Products | Materials | Resell) --- */
.sale-toggle-container {
    display: inline-flex;
    align-items: center;
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    padding: 2px;
    position: relative;
    width: 350px; /* 5 × 70px slots */
    height: 32px;
    cursor: pointer;
    user-select: none;
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.05);
}

.sale-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    background-color: #9333ea; /* royal purple (purple-600) */
    width: 66px;
    height: 26px;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(147, 51, 234, 0.2), 0 2px 4px -1px rgba(147, 51, 234, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Slot positions */
.sale-toggle-container.mode-mix      .sale-toggle-slider { transform: translateX(0);     }
.sale-toggle-container.mode-product  .sale-toggle-slider { transform: translateX(70px);  }
.sale-toggle-container.mode-material .sale-toggle-slider { transform: translateX(140px); }
.sale-toggle-container.mode-resell   .sale-toggle-slider { transform: translateX(210px); }
.sale-toggle-container.mode-service  .sale-toggle-slider { transform: translateX(280px); }

.sale-toggle-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 10;
}

.sale-toggle-label {
    width: 20%;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: #64748b; /* slate-500 */
    transition: color 0.25s ease;
    letter-spacing: 0.01em;
}

/* Active label states */
.sale-toggle-container.mode-product  .label-prod   { color: #ffffff; }
.sale-toggle-container.mode-material .label-mat    { color: #ffffff; }
.sale-toggle-container.mode-resell   .label-resell { color: #ffffff; }
.sale-toggle-container.mode-mix      .label-mix    { color: #ffffff; }
.sale-toggle-container.mode-service  .label-service { color: #ffffff; }

#sale-form-mode-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0 6px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 14px;
}
/* ── Company Profile editable field styles ── */
.cp-editable-field {
  display: block;
  padding: 0.35rem 0.6rem;
  transition: all 0.2s ease;
  border-radius: 8px;
  border: 1px solid transparent;
  outline: none;
}

.cp-editable-field:hover {
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
}

.cp-editable-field:focus {
  border-color: #a855f7 !important;
  background: #faf5ff !important;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15) !important;
}

/* Field group: wraps the label-row + input-row */
.cp-field-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Label row: label text + pencil button side by side */
.cp-field-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cp-field-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}

/* Input row: input + optional inline pencil (for name/tagline) */
.cp-field-row {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

/* ✏️ Pencil edit button */
.cp-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.18s ease, background 0.18s ease, transform 0.15s ease;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

.cp-edit-btn:hover {
  opacity: 1;
  background: #eef2ff;
  transform: scale(1.15);
}

.cp-edit-btn:active {
  transform: scale(0.92);
  background: #e0e7ff;
}

.cp-edit-icon {
  display: block;
  pointer-events: none;
  flex-shrink: 0;
}

/* Template radio grid */
.cp-template-radio input[type="radio"]:checked + .cp-template-label {
  background: #f0fdf4;
  color: #16a34a;
  font-weight: 600;
  border-bottom-color: #16a34a;
}

/* Logo zone */
.cp-logo-zone:hover img {
  opacity: 0.7;
}

/* Color picker round button polish */
#company-invoice-color {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fff;
  cursor: pointer;
}
#company-invoice-color::-webkit-color-swatch-wrapper { padding: 0; }
#company-invoice-color::-webkit-color-swatch { border: none; border-radius: 50%; }

/* -- Logo Container and Preview Sizing Constraints -- */
.cp-logo-container {
  width: 128px !important;
  height: 128px !important;
  max-width: 128px !important;
  max-height: 128px !important;
  min-width: 128px !important;
  min-height: 128px !important;
  flex-shrink: 0 !important;
  background-color: #ffffff !important;
}

.cp-logo-container img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

/* --- Resell Form Section Cards --- */
.resell-customer-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}
.resell-customer-card h3 {
    color: #1d4ed8;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.resell-supplier-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}
.resell-supplier-card h3 {
    color: #c2410c;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.resell-computed-field {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    font-weight: 600;
}

/* --- WhatsApp Brand Colors --- */
.whatsapp-brand-color {
    color: #25D366 !important;
}
.whatsapp-brand-color i, .whatsapp-brand-color svg {
    color: #25D366 !important;
}
.whatsapp-brand-color:hover {
    color: #128C7E !important;
}
.whatsapp-brand-color:hover i, .whatsapp-brand-color:hover svg {
    color: #128C7E !important;
}
.whatsapp-brand-bg {
    background-color: #25D366 !important;
}
.whatsapp-brand-bg:hover {
    background-color: #128C7E !important;
}

/* --- Foldable Sidebar Styles --- */
/* Collapsed state */
.sidebar-format.collapsed {
    width: 78px !important;
    min-width: 78px !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

.sidebar-format.collapsed .sidebar-header > .flex {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.65rem !important;
    padding: 0.75rem 0 !important;
}

.sidebar-format.collapsed .sidebar-header .logo-container {
    flex: none !important;
    width: 100% !important;
    justify-content: center !important;
}

.sidebar-format.collapsed .sidebar-header .logo-full {
    display: none !important;
}

.sidebar-format.collapsed .sidebar-header .logo-collapsed {
    display: inline-block !important;
}

.sidebar-format.collapsed #sidebar-notification-btn {
    margin: 0 auto !important;
}

.sidebar-format.collapsed .sidebar-nav button span {
    display: none !important;
}

/* When collapsed, hide the quick-add (+) buttons with max specificity */
.sidebar-format.collapsed .sidebar-nav .nav-item-group .nav-quick-add-btn,
.sidebar-format.collapsed .nav-quick-add-btn {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.sidebar-format.collapsed .sidebar-nav button {
    justify-content: center !important;
    padding: 0.9rem 0 !important;
    width: 100% !important;
}

.sidebar-format.collapsed .sidebar-footer .flex.items-center.gap-2 {
    justify-content: center !important;
    padding: 0.5rem !important;
}

.sidebar-format.collapsed .sidebar-footer .text-sm {
    display: none !important;
}

.sidebar-format.collapsed #logout-btn span {
    display: none !important;
}

.sidebar-format.collapsed #logout-btn {
    padding: 0.75rem 0 !important;
    justify-content: center !important;
}

/* Smooth transition for main content as sidebar resizes */
main {
    transition: padding-left 0.3s ease;
}

/* Sidebar toggle button positioning — moves with sidebar */
#sidebar-toggle-btn {
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When sidebar is collapsed, slide the toggle button left */
body.sidebar-collapsed #sidebar-toggle-btn {
    left: 65px !important;
}

/* Prevent sidebar shadow/blur from bleeding onto the toggle button */
#sidebar-toggle-btn {
    isolation: isolate;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Ensure WhatsApp SVG icon always shows brand green */
#modal-whatsapp-btn svg {
    fill: #25D366 !important;
}
#modal-whatsapp-btn:hover svg {
    fill: #128C7E !important;
}

/* Desktop-only utility: hidden on mobile, shown on desktop */
.desktop-only {
    display: flex;
}
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

/* Bill Template Active State & Mobile Layout */
.cp-template-radio {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
}
.cp-template-radio label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
}
.cp-template-radio .cp-preview-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}
.cp-template-radio:has(input:checked) {
    border-color: #22c55e !important;
    background-color: #f0fdf4 !important;
    box-shadow: 0 0 0 1px #22c55e, 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}
.cp-template-radio:has(input:checked) .cp-template-label {
    font-weight: 600 !important;
    color: #15803d !important;
}

@media (max-width: 768px) {
    .cp-template-radio .cp-preview-text {
        display: none !important;
    }
}

/* Discount type toggle buttons (Rs vs %) */
#sale-discount-type-fixed,
#sale-discount-type-percent {
    transition: color 0.15s ease-in-out, font-size 0.15s ease-in-out;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#sale-discount-type-fixed.is-active,
#sale-discount-type-percent.is-active {
    color: #7e22ce !important; /* purple-700 */
    font-weight: 800 !important;
}
#sale-discount-type-fixed.is-active:hover,
#sale-discount-type-percent.is-active:hover {
    color: #581c87 !important; /* purple-900 */
}
#sale-discount-type-percent.is-active {
    font-weight: 900 !important;
    font-size: 13.5px !important;
}
#sale-discount-type-fixed:not(.is-active),
#sale-discount-type-percent:not(.is-active) {
    color: #9ca3af !important; /* gray-400 */
    font-weight: 500 !important;
    font-size: 12px !important;
}
#sale-discount-type-fixed:not(.is-active):hover,
#sale-discount-type-percent:not(.is-active):hover {
    color: #4b5563 !important; /* gray-600 */
}


/* =====================================================
   Welcome Screen Customization - welcome-screen.js
   ===================================================== */

/* Welcome Settings Gear Button */
#welcome-settings-btn {
  backdrop-filter: blur(8px);
}
#welcome-settings-btn:hover i[data-lucide="settings"],
#welcome-settings-btn:focus i[data-lucide="settings"] {
  transform: rotate(90deg);
}

/* Welcome Customize Modal - module cards */
.welcome-module-card {
  user-select: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.welcome-module-card:hover {
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.08);
}

/* Category block spacing */
.welcome-category-block + .welcome-category-block {
  border-top: 1px solid #f3f4f6;
  padding-top: 1.25rem;
}

/* Line clamp utility (for descriptions) */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Welcome screen section positioning for the gear button */
#welcome {
  position: relative;
}
