/* ============================================
   ACTION TOOLBAR - Professional & Compact UI
   Modern redesign for buttons and filters area
   ============================================ */

/* ============================================
   CSS Variables for Action Toolbar
   ============================================ */
:root {
    --toolbar_bg: #ffffff;
    --toolbar_border: #e5e7eb;
    --toolbar_shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --toolbar_gap: 8px;
    --toolbar_padding_x: 12px;
    --toolbar_padding_y: 6px;
    
    --btn_height: 32px;
    --btn_font_size: 13px;
    --btn_border_radius: 6px;
    --btn_padding_x: 12px;
    --btn_gap: 6px;
    
    --filter_input_height: 32px;
    --filter_font_size: 13px;
    
    --divider_color: #e5e7eb;
    --icon_size: 16px;
}

/* ============================================
   Main Buttons Row Container
   ============================================ */
body.pc .subModule-container .buttonsRow {
    height: auto !important;
    min-height: 44px;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow: visible; /* Allow dropdowns/popovers to show */
    box-sizing: border-box;
}

body.pc .subModule-container.with_tab_filter_panel .buttonsRow {
    --buttons_row_height: auto;
}

/* ============================================
   Button Panel - Main Container
   ============================================ */
body.pc .button-panel {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--toolbar_bg);
    /*border-bottom: 1px solid var(--toolbar_border);*/
    padding: var(--toolbar_padding_y) var(--toolbar_padding_x);
    min-height: 44px;
    /*box-shadow: var(--toolbar_shadow);*/
    width: 99.40%;
    max-width: 99.40%;
    margin-inline: auto;
    border-radius: 8px 8px 0 0;
    overflow: visible; /* Allow dropdowns/popovers to show */
    padding-top: 10px;
    padding-bottom: 20px;
    margin-bottom: -7px;
}

body.pc .button-panel > table.hundred-percent-x {
    width: 100%;
    max-width: 100%;
    table-layout: fixed; /* Force table to respect width constraints */
}

body.pc .button-panel > table.hundred-percent-x > tr {
    display: flex;
    align-items: center;
    width: 100%;
    flex-wrap: wrap; /* Allow wrapping when needed */
    gap: 6px 0;
}

body.pc .button-panel > table.hundred-percent-x > tr > td {
    display: flex;
    align-items: center;
    min-width: 0; /* Allow shrinking */
}

/* First TD contains gridViewButtonsContainer (action buttons) */
body.pc .button-panel > table.hundred-percent-x > tr > td:first-child {
    flex: 0 1 auto;
    min-width: 0;
    overflow: visible;
    order: 2; /* Move action buttons to the right */
}

/* Last TD contains defaultButtonsContainer (inline filters + view toggles) */
body.pc .button-panel > table.hundred-percent-x > tr > td:last-child {
    flex: 1 1 auto;
    order: 1; /* Keep this on the left */
    margin-left: 0;
    justify-content: space-between; /* Space between filters (left) and toggles (right) */
}

/* ============================================
   FormView Button Panel - Right align single element
   ============================================ */
body.pc .formview-view .button-panel,
body.pc .formview-container .formview-main .button-panel {
    justify-content: flex-end; /* Align content to the right */
    position: absolute;
    top: 5px;
    right: 38px;
}

body.pc .formview-view .button-panel > *,
body.pc .formview-container .formview-main .button-panel > * {
    /*margin-left: auto; !* Push single element to the right *!*/
}

/* ============================================
   Grid View Buttons Container
   ============================================ */
body.pc .gridViewButtonsContainer {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--btn_gap);
    padding: 2px 0;
    min-height: auto !important;
    flex: 1;
    min-width: 0; /* Allow shrinking below content size */
    overflow: visible; /* Allow dropdowns to show */
}

body.pc .gridViewButtonsContainer:not(:empty) {
    min-height: auto;
}

body.pc .gridViewButtonsContainer:empty {
    display: none !important;
}

body.pc .subModule-container.single_data_row_context_menu_shown .gridViewButtonsContainer{
    opacity: 0;
    display: none !important;
}

/* Button Groups - Compact */
body.pc .gridViewButtonsContainer .buttonGroup {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    margin: 0;
    position: relative;
    flex: 0 1 auto; /* Allow shrinking */
    min-width: 0;
    flex-wrap: wrap;
}

body.pc .gridViewButtonsContainer .buttonGroup > span {
    display: none; /* Hide group label for cleaner look */
}

body.pc .gridViewButtonsContainer .groupButtonContainer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    min-width: 0;
}

/* Divider between button groups */
body.pc .gridViewButtonsContainer .buttonGroup:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 1px;
    background: var(--divider_color);
}

/* ============================================
   Compact Button Styling (Override)
   ============================================ */
body.pc .gridViewButtonsContainer button.logic_button {
    height: var(--btn_height);
    padding: 0 var(--btn_padding_x);
    font-size: var(--btn_font_size);
    font-weight: 500;
    border-radius: var(--btn_border_radius);
    margin: 0;
    min-width: auto;
    gap: 5px;
    line-height: 1;
    transition: all 0.15s ease;
    flex: 0 0 auto; /* Don't grow or shrink by default */
    max-width: 100%; /* Prevent overflow */
}

body.pc .gridViewButtonsContainer button.logic_button .button_display_name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /*max-width: 120px; !* Limit text width *!*/
}

body.pc .gridViewButtonsContainer button.logic_button .lucide_icon {
    width: var(--icon_size);
    height: var(--icon_size);
    flex-shrink: 0; /* Don't shrink icons */
}

body.pc .gridViewButtonsContainer button.logic_button .lucide_icon svg {
    width: 100%;
    height: 100%;
}

body.pc .gridViewButtonsContainer button.logic_button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.3);
}

/* Hide disabled buttons option */
body.pc .gridViewButtonsContainer button.logic_button.hideWhenDisabled:disabled {
    display: none;
}

/* ============================================
   Default Buttons Container (View Toggles + Filter Buttons)
   ============================================ */
body.pc .defaultButtonsContainer {
    display: flex;
    align-items: center;
    gap: var(--toolbar_gap);
    height: auto;
    padding: 0;
    margin-left: 0;
    flex: 1 1 auto; /* Allow growing */
    flex-wrap: wrap;
    justify-content: flex-start; /* Align items to start, filters will push to left */
}

body.pc .setDisplayModeButtonsContainer {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 3px;
    /*margin-left: auto; !* Push to the right *!*/
    order: 2; /* View toggles on the right */
}

/* View Mode Toggle Icons */
body.pc .setDisplayModeButtonsContainer .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    opacity: 0.5;
    border-radius: 6px;
    background: transparent;
    transition: all 0.15s ease;
}

body.pc .setDisplayModeButtonsContainer .icon:hover {
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.05);
}

body.pc .setDisplayModeButtonsContainer .icon.selected {
    opacity: 1;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-bottom: none;
}

body.pc .setDisplayModeButtonsContainer .icon svg {
    width: 16px;
    height: 16px;
    color: #374151;
}

/* ============================================
   Filter Button - Show Filters
   ============================================ */
body.pc .defaultButtonsContainer .show_filters_popup_button {
    height: var(--btn_height);
    padding: 0 12px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: var(--btn_font_size);
    font-weight: 500;
    border: 1px solid var(--toolbar_border);
    border-radius: var(--btn_border_radius);
    background: #ffffff;
    color: #374151;
    transition: all 0.15s ease;
    box-shadow: none;
    order: 3; /* After view toggles on the right */
}

body.pc .defaultButtonsContainer .show_filters_popup_button:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
    transform: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.pc .defaultButtonsContainer .show_filters_popup_button:active {
    background: #f3f4f6;
    transform: none;
}

body.pc .defaultButtonsContainer .show_filters_popup_button svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 2;
}

body.pc .defaultButtonsContainer .show_filter_side_popup_button_text {
    font-size: var(--btn_font_size);
    line-height: 1;
    font-weight: 500;
}

/* ============================================
   Clear Applied Filters Button
   ============================================ */
body.pc .defaultButtonsContainer .clear_applied_filters_button {
    height: var(--btn_height);
    padding: 0 10px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: var(--btn_font_size);
    font-weight: 500;
    border: 1px solid #fca5a5;
    border-radius: var(--btn_border_radius);
    background: #fef2f2;
    color: #dc2626;
    transition: all 0.15s ease;
    box-shadow: none;
    order: 4; /* After show filters button on the right */
}

body.pc .defaultButtonsContainer .clear_applied_filters_button:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #b91c1c;
    transform: none;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.1);
}

body.pc .defaultButtonsContainer .clear_applied_filters_button svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

body.pc .defaultButtonsContainer .clear_applied_filters_button .clear_icon {
    margin-left: 2px;
    opacity: 0.7;
}

body.pc .defaultButtonsContainer .clear_applied_filters_button:hover .clear_icon {
    opacity: 1;
}

body.pc .defaultButtonsContainer .clear_applied_filters_button_label {
    font-size: var(--btn_font_size);
    line-height: 1;
    font-weight: 500;
}

body.pc .defaultButtonsContainer .clear_applied_filters_button_text {
    display: none;
}

/* ============================================
   Inline Filter Panel - Professional Compact Design
   ============================================ */
body.pc .filter-inlineTabFilterPanel {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 0;
    margin: 0;
    flex: 0 1 auto; /* Don't grow, allow shrinking */
    min-width: 0; /* Allow shrinking below content size */
    overflow: visible; /* Allow dropdowns/popovers to show */
    flex-wrap: wrap;
    order: 1; /* Filters first (left) */
}

body.pc .filter-inlineTabFilterPanel:empty {
    display: none;
}

/* Individual Filter Container in Inline Panel */
body.pc .filter-inlineTabFilterPanel .filter-container {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    --spacing_md: 0;
    --spacing_lg: 0;
    position: relative;
    z-index: 10;
}

body.pc .filter-inlineTabFilterPanel .filter-container .filter-display-name,
body.pc .filter-inlineTabFilterPanel .filter-container .filter_label {
    display: none;
}

body.pc .filter-inlineTabFilterPanel .filter-container .filter-form-elements {
    margin: 0;
}

/* Filter Input Styling for Inline Filters */
body.pc .filter-inlineTabFilterPanel .filter-container select,
body.pc .filter-inlineTabFilterPanel .filter-container input[type="text"],
body.pc .filter-inlineTabFilterPanel .filter-container input[type="search"],
body.pc .filter-inlineTabFilterPanel .filter-container input[type="date"],
body.pc .filter-inlineTabFilterPanel .filter-container input[type="number"],
body.pc .filter-inlineTabFilterPanel .filter-container .chosen-container a {
    height: var(--filter_input_height) !important;
    min-height: var(--filter_input_height);
    padding: 0 10px ;
    padding-inline-start: 32px ;
    font-size: var(--filter_font_size) !important;
    border: 1px solid var(--toolbar_border) !important;
    border-radius: var(--btn_border_radius) !important;
    background-color: #f9fafb !important;
    color: #374151 !important;
    transition: all 0.15s ease !important;
    line-height: var(--filter_input_height) !important;
    width: auto;
    flex: 0 1 auto; /* Allow shrinking */
}

body.pc .filter-inlineTabFilterPanel .filter-container select:hover,
body.pc .filter-inlineTabFilterPanel .filter-container input[type="text"]:hover,
body.pc .filter-inlineTabFilterPanel .filter-container input[type="search"]:hover,
body.pc .filter-inlineTabFilterPanel .filter-container input[type="date"]:hover,
body.pc .filter-inlineTabFilterPanel .filter-container .chosen-container a:hover {
    border-color: #d1d5db !important;
    background-color: #ffffff !important;
}

body.pc .filter-inlineTabFilterPanel .filter-container select:focus,
body.pc .filter-inlineTabFilterPanel .filter-container input[type="text"]:focus,
body.pc .filter-inlineTabFilterPanel .filter-container input[type="search"]:focus,
body.pc .filter-inlineTabFilterPanel .filter-container input[type="date"]:focus,
body.pc .filter-inlineTabFilterPanel .filter-container .chosen-container a:focus {
    border-color: #3b82f6 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1) !important;
    outline: none !important;
}

/* Tab Filter Options - Compact Pill Style */
body.pc .filter-inlineTabFilterPanel .filter-tabOptions {
    display: inline-flex;
    gap: 2px;
    border: none;
    padding: 3px;
    border-radius: 8px;
    background: #f3f4f6;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow: visible;
}

body.pc .filter-inlineTabFilterPanel .filter-tabOptions label {
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 5px;
    text-transform: none;
    transition: all 0.15s ease;
    background: transparent;
    color: #6b7280;
    border: none;
    white-space: nowrap;
    line-height: 1.2;
}

body.pc .filter-inlineTabFilterPanel .filter-tabOptions label:hover {
    color: #374151;
    background: rgba(255, 255, 255, 0.5);
}

body.pc .filter-inlineTabFilterPanel .filter-tabOptions input:checked + label {
    background: #ffffff;
    color: #111827;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Divider Line */
body.pc .filter-inlineTabFilterPanel::after {
    content: '';
    display: block;
    width: 1px;
    height: 24px;
    background: var(--divider_color);
    margin-left: 4px;
}

body.pc .filter-inlineTabFilterPanel:empty::after {
    display: none;
}

/* ============================================
   Compact Table Layout Fix
   ============================================ */
body.pc .button-panel table.hundred-percent-x {
    border-collapse: collapse;
    border-spacing: 0;
}

body.pc .button-panel table.hundred-percent-x tr {
    display: flex;
    align-items: center;
}

body.pc .button-panel table.hundred-percent-x td {
    padding: 0;
    vertical-align: middle;
}

/* Hide unused search container */
body.pc td.searchButtonsContainerParent {
    display: none;
}

/* ============================================
   Responsive Adjustments - Adaptive Layout
   ============================================ */

/* Large screens - Normal display */
@media screen and (min-width: 1401px) {
    body.pc .gridViewButtonsContainer button.logic_button .button_display_name {
        display: inline;
    }
}

/* Medium-large screens - Slightly compact */
@media screen and (max-width: 1400px) {
    body.pc .gridViewButtonsContainer {
        gap: 4px;
    }
    
    body.pc .gridViewButtonsContainer button.logic_button {
        padding: 0 10px;
    }
    
    body.pc .filter-inlineTabFilterPanel {
        gap: 6px;
    }
}

/* Medium screens - Hide button text when icon exists */
@media screen and (max-width: 1200px) {
    body.pc .gridViewButtonsContainer {
        gap: 3px;
    }
    
    body.pc .gridViewButtonsContainer button.logic_button {
        padding: 0 8px;
        font-size: 12px;
    }
    
    /* Hide text when button has icon */
    body.pc .gridViewButtonsContainer button.logic_button .lucide_icon ~ .button_display_name {
        display: none;
    }
    
    body.pc .filter-inlineTabFilterPanel {
        gap: 4px;
        margin-right: 8px;
    }
    
    body.pc .filter-inlineTabFilterPanel .filter-container select,
    body.pc .filter-inlineTabFilterPanel .filter-container input {
        font-size: 12px !important;
    }
    
    body.pc .filter-inlineTabFilterPanel .filter-tabOptions label {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Smaller screens - Very compact */
@media screen and (max-width: 992px) {
    body.pc .button-panel {
        padding: 4px 8px;
    }
    
    body.pc .button-panel > table.hundred-percent-x > tr {
        gap: 4px 0;
    }
    
    body.pc .gridViewButtonsContainer {
        gap: 2px;
    }
    
    body.pc .gridViewButtonsContainer button.logic_button {
        padding: 0 6px;
        height: 28px;
    }
    
    /* Hide all button text, show only icons */
    body.pc .gridViewButtonsContainer button.logic_button .button_display_name {
        display: none;
    }
    
    body.pc .gridViewButtonsContainer .buttonGroup {
        padding: 0 4px;
    }
    
    body.pc .defaultButtonsContainer {
        gap: 4px;
    }
    
    body.pc .defaultButtonsContainer .show_filter_side_popup_button_text {
        display: none;
    }
    
    body.pc .defaultButtonsContainer .show_filters_popup_button {
        padding: 0 8px;
        height: 28px;
    }
    
    body.pc .defaultButtonsContainer .clear_applied_filters_button {
        padding: 0 8px;
        height: 28px;
    }
    
    body.pc .defaultButtonsContainer .clear_applied_filters_button_label {
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    body.pc .setDisplayModeButtonsContainer {
        padding: 2px;
    }
    
    body.pc .setDisplayModeButtonsContainer .icon {
        width: 24px;
        height: 24px;
    }
    
    body.pc .filter-inlineTabFilterPanel {
        gap: 3px;
        margin-right: 6px;
    }
    
    body.pc .filter-inlineTabFilterPanel .filter-container select,
    body.pc .filter-inlineTabFilterPanel .filter-container input {
        height: 28px !important;
        font-size: 11px !important;
        padding-inline-start: 8px !important;
    }
    
    body.pc .filter-inlineTabFilterPanel .filter-tabOptions {
        padding: 2px;
    }
    
    body.pc .filter-inlineTabFilterPanel .filter-tabOptions label {
        padding: 3px 6px;
        font-size: 10px;
    }
    
    /* Hide divider on small screens */
    body.pc .filter-inlineTabFilterPanel::after {
        display: none;
    }
}

/* Extra small screens - Stacked layout */
@media screen and (max-width: 768px) {
    body.pc .button-panel > table.hundred-percent-x > tr {
        flex-direction: column;
        align-items: stretch;
    }
    
    body.pc .button-panel > table.hundred-percent-x > tr > td:first-child {
        order: 2;
        width: 100%;
        justify-content: flex-start;
        padding-top: 4px;
    }
    
    body.pc .button-panel > table.hundred-percent-x > tr > td:last-child {
        order: 1;
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }
    
    body.pc .gridViewButtonsContainer {
        width: 100%;
        justify-content: flex-start;
    }
    
    body.pc .defaultButtonsContainer {
        width: 100%;
        justify-content: flex-end;
    }
    
    body.pc .filter-inlineTabFilterPanel {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 2px;
    }
    
    body.pc .filter-inlineTabFilterPanel::-webkit-scrollbar {
        display: none;
    }
}

/* ============================================
   Dark Theme Compatibility
   ============================================ */
.dark_theme .button-panel {
    --toolbar_bg: #1e293b;
    --toolbar_border: #334155;
    --toolbar_shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    --divider_color: #475569;
}

.dark_theme .setDisplayModeButtonsContainer {
    background: #0f172a;
}

.dark_theme .setDisplayModeButtonsContainer .icon.selected {
    background: #334155;
}

.dark_theme .setDisplayModeButtonsContainer .icon svg {
    color: #94a3b8;
}

.dark_theme .setDisplayModeButtonsContainer .icon.selected svg {
    color: #e2e8f0;
}

.dark_theme .defaultButtonsContainer .show_filters_popup_button {
    background: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
}

.dark_theme .defaultButtonsContainer .show_filters_popup_button:hover {
    background: #334155;
    border-color: #64748b;
    color: #f8fafc;
}

.dark_theme .defaultButtonsContainer .clear_applied_filters_button {
    background: rgba(127, 29, 29, 0.5);
    border-color: #dc2626;
    color: #fca5a5;
}

.dark_theme .defaultButtonsContainer .clear_applied_filters_button:hover {
    background: rgba(153, 27, 27, 0.7);
    border-color: #f87171;
    color: #fee2e2;
}

.dark_theme .filter-inlineTabFilterPanel .filter-tabOptions {
    background: #0f172a;
}

.dark_theme .filter-inlineTabFilterPanel .filter-tabOptions label {
    color: #94a3b8;
}

.dark_theme .filter-inlineTabFilterPanel .filter-tabOptions label:hover {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.05);
}

.dark_theme .filter-inlineTabFilterPanel .filter-tabOptions input:checked + label {
    background: #334155;
    color: #f8fafc;
}

.dark_theme .filter-inlineTabFilterPanel .filter-container select,
.dark_theme .filter-inlineTabFilterPanel .filter-container input[type="text"],
.dark_theme .filter-inlineTabFilterPanel .filter-container input[type="search"],
.dark_theme .filter-inlineTabFilterPanel .filter-container input[type="date"] {
    background-color: #0f172a !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

.dark_theme .filter-inlineTabFilterPanel .filter-container select:hover,
.dark_theme .filter-inlineTabFilterPanel .filter-container input:hover {
    background-color: #1e293b !important;
    border-color: #64748b !important;
}

.dark_theme .filter-inlineTabFilterPanel .filter-container select:focus,
.dark_theme .filter-inlineTabFilterPanel .filter-container input:focus {
    background-color: #1e293b !important;
    border-color: #3b82f6 !important;
}

/* ============================================
   Smooth Transitions
   ============================================ */
body.pc .buttonsRow,
body.pc .button-panel,
body.pc .gridViewButtonsContainer,
body.pc .defaultButtonsContainer,
body.pc .filter-inlineTabFilterPanel {
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

/*body.pc .without_tab_filter_panel .subModule-container-table .buttonsRow .button-panel .hundred-percent-x tr{*/
/*    flex-direction: row-reverse !important;*/
/*}*/

/* ============================================
   Button Overflow Menu
   ============================================ */
body.pc .button_overflow_container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

body.pc .button_overflow_toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border: 1px solid var(--toolbar_border, #e5e7eb);
    border-radius: var(--btn_border_radius, 6px);
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #6b7280;
}

body.pc .button_overflow_toggle:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

body.pc .button_overflow_toggle.active {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}

body.pc .button_overflow_toggle svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

body.pc .button_overflow_menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 1000;
    min-width: 180px;
    max-width: 280px;
    background: #ffffff;
    border: 1px solid var(--toolbar_border, #e5e7eb);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.06);
    padding: 4px;
    display: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

body.pc .button_overflow_menu.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

body.pc .button_overflow_menu_item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

body.pc .button_overflow_menu_item:hover {
    background: #f3f4f6;
    color: #111827;
}

body.pc .button_overflow_menu_item:active {
    background: #e5e7eb;
}

body.pc .button_overflow_menu_item.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

body.pc .button_overflow_menu_item .overflow_menu_icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #6b7280;
    flex-shrink: 0;
}

body.pc .button_overflow_menu_item .overflow_menu_icon svg {
    width: 16px;
    height: 16px;
}

body.pc .button_overflow_menu_item:hover .overflow_menu_icon {
    color: #374151;
}

body.pc .button_overflow_menu_item .overflow_menu_text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dark theme support for overflow menu */
.dark_theme .button_overflow_toggle {
    background: #1e293b;
    border-color: #475569;
    color: #94a3b8;
}

.dark_theme .button_overflow_toggle:hover {
    background: #334155;
    border-color: #64748b;
    color: #cbd5e1;
}

.dark_theme .button_overflow_toggle.active {
    background: #475569;
    color: #e2e8f0;
}

.dark_theme .button_overflow_menu {
    background: #1e293b;
    border-color: #475569;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark_theme .button_overflow_menu_item {
    color: #cbd5e1;
}

.dark_theme .button_overflow_menu_item:hover {
    background: #334155;
    color: #f8fafc;
}

.dark_theme .button_overflow_menu_item:active {
    background: #475569;
}

.dark_theme .button_overflow_menu_item .overflow_menu_icon {
    color: #94a3b8;
}

.dark_theme .button_overflow_menu_item:hover .overflow_menu_icon {
    color: #cbd5e1;
}

/* Hidden disabled state for overflow menu items and toolbar buttons */
body.pc .button_overflow_menu_item.hidden_disabled,
body.pc .button_overflow_toggle.hidden_disabled {
    display: none !important;
}

/* Buttons that should only appear in overflow menu (not in toolbar) */
body.pc .gridViewButtonsContainer .overflow_only {
    display: none !important;
}

/* Form view buttons that should only appear in overflow menu */
body.pc .button-panel .overflow_only {
    display: none !important;
}

/* Promoted button from overflow - shown directly in toolbar when it's the only enabled overflow button */
body.pc .promoted_from_overflow {
    /* Ensure consistent styling with other toolbar buttons */
}

/* ============================================
   Form View Overflow Menu Specific Styles
   ============================================ */
body.pc .form_view_overflow {
    margin-left: 8px;
}

body.pc .form_view_overflow_toggle {
    /* Inherit styles from .button_overflow_toggle */
}

body.pc .form_view_overflow_menu {
    /* Inherit styles from .button_overflow_menu */
}