/**
 * Elettro Preventivi Styles
 * Compatible with XStore Theme
 */

/* Main Wrapper */
#elettro-preventivi-wrap {
    margin: 0;
    padding: 20px 0;
    font-family: inherit;
    line-height: 1.6;
    color: #333;
}

/* Header with title and button */
#elettro-preventivi-wrap .preventivi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
    flex-wrap: wrap;
    gap: 15px;
}

#elettro-preventivi-wrap .preventivi-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: #222;
}

/* New Quote Button */
#elettro-preventivi-wrap .nuovo-preventivo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0a7e50 0%, #086942 100%);
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(10, 126, 80, 0.3);
}

#elettro-preventivi-wrap .nuovo-preventivo-btn:hover {
    background: linear-gradient(135deg, #086942 0%, #065535 100%);
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 126, 80, 0.4);
}

#elettro-preventivi-wrap .nuovo-preventivo-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Search Form */
#elettro-preventivi-wrap #preventivi-search {
    display: flex;
    margin-bottom: 25px;
    max-width: 500px;
}

#elettro-preventivi-wrap #preventivi-search .text-field {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#elettro-preventivi-wrap #preventivi-search .text-field:focus {
    border-color: #0a7e50;
}

#elettro-preventivi-wrap #preventivi-search .search-submit {
    padding: 12px 24px;
    background: #0a7e50;
    color: #fff;
    border: 1px solid #0a7e50;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

#elettro-preventivi-wrap #preventivi-search .search-submit:hover {
    background: #086942;
}

/* Status Filters */
#elettro-preventivi-wrap .preventivi-filter {
    margin-bottom: 25px;
}

#elettro-preventivi-wrap ul.preventivi-status-filter {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 0;
}

#elettro-preventivi-wrap ul.preventivi-status-filter li {
    display: inline-block;
}

#elettro-preventivi-wrap ul.preventivi-status-filter li:after {
    content: "|";
    margin: 0 12px;
    color: #ccc;
}

#elettro-preventivi-wrap ul.preventivi-status-filter li:last-of-type:after {
    content: "";
    margin: 0;
}

#elettro-preventivi-wrap ul.preventivi-status-filter li a {
    text-decoration: none;
    color: #0073aa;
    font-size: 14px;
    transition: color 0.2s;
}

#elettro-preventivi-wrap ul.preventivi-status-filter li a:hover {
    color: #005177;
}

#elettro-preventivi-wrap ul.preventivi-status-filter li.current a {
    font-weight: 700;
    color: #222;
}

/* Table */
#elettro-preventivi-wrap .table,
#elettro-preventivi-wrap .preventivi-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.12);
}

#elettro-preventivi-wrap .table th,
#elettro-preventivi-wrap .table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

#elettro-preventivi-wrap .table thead th {
    background: #f8f9fa;
    font-weight: 600;
    color: #444;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

#elettro-preventivi-wrap .table tbody tr:hover {
    background: #fafafa;
}

#elettro-preventivi-wrap .table tbody tr:last-child td {
    border-bottom: none;
}

#elettro-preventivi-wrap .table .order_number a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

#elettro-preventivi-wrap .table .order_number a:hover {
    color: #005177;
    text-decoration: underline;
}

/* Status marks - Badge style */
#elettro-preventivi-wrap mark {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
    background: #e0e0e0;
    color: #333;
}

#elettro-preventivi-wrap mark.ywraq-new {
    background: #e3f2fd;
    color: #1565c0;
}

#elettro-preventivi-wrap mark.ywraq-pending {
    background: #fff3e0;
    color: #e65100;
}

#elettro-preventivi-wrap mark.ywraq-expired {
    background: #f5f5f5;
    color: #616161;
}

#elettro-preventivi-wrap mark.ywraq-accepted {
    background: #e8f5e9;
    color: #2e7d32;
}

#elettro-preventivi-wrap mark.ywraq-rejected {
    background: #ffebee;
    color: #c62828;
}

/* Order Actions */
#elettro-preventivi-wrap td.order_actions {
    white-space: nowrap;
    text-align: center;
}

#elettro-preventivi-wrap td.order_actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    margin: 0 2px;
    font-size: 0;
    text-decoration: none;
    transition: all 0.2s ease;
}

#elettro-preventivi-wrap td.order_actions a:hover {
    transform: scale(1.1);
}

#elettro-preventivi-wrap td.order_actions a:after {
    font-family: Dashicons;
    font-size: 16px;
    color: #fff;
}

/* Action button colors */
#elettro-preventivi-wrap td.order_actions a.edit {
    background: #0a7e50;
}
#elettro-preventivi-wrap td.order_actions a.edit:after {
    content: "\f464";
}

#elettro-preventivi-wrap td.order_actions a.pdf {
    background: #d63638;
}
#elettro-preventivi-wrap td.order_actions a.pdf:after {
    content: "\f497";
}

#elettro-preventivi-wrap td.order_actions a.email {
    background: #dba617;
}
#elettro-preventivi-wrap td.order_actions a.email:after {
    content: "\f465";
}

#elettro-preventivi-wrap td.order_actions a.convert {
    background: #2271b1;
}
#elettro-preventivi-wrap td.order_actions a.convert:after {
    content: "\f147";
}

#elettro-preventivi-wrap td.order_actions a.delete {
    background: #b32d2e;
}
#elettro-preventivi-wrap td.order_actions a.delete:after {
    content: "\f182";
}

/* Tooltips */
#elettro-preventivi-wrap td.order_actions a:hover:before {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
}

#elettro-preventivi-wrap td.order_actions a {
    position: relative;
}

/* Pagination */
#elettro-preventivi-wrap .pagination {
    margin: 30px 0;
    text-align: center;
}

#elettro-preventivi-wrap .pagination a,
#elettro-preventivi-wrap .pagination span {
    display: inline-block;
    padding: 10px 16px;
    margin: 0 3px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

#elettro-preventivi-wrap .pagination a:hover {
    background: #f5f5f5;
    border-color: #0a7e50;
    color: #0a7e50;
}

#elettro-preventivi-wrap .pagination .current {
    background: #0a7e50;
    border-color: #0a7e50;
    color: #fff;
}

/* No results */
#elettro-preventivi-wrap .no-preventivi {
    padding: 60px 40px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 8px;
}

#elettro-preventivi-wrap .no-preventivi p {
    margin: 0 0 20px;
    font-size: 16px;
    color: #666;
}

#elettro-preventivi-wrap .no-preventivi .button {
    display: inline-block;
    padding: 12px 24px;
    background: #0a7e50;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
}

/* ============================================
   QUOTE EDIT PAGE
   ============================================ */

#elettro-preventivi-edit {
    max-width: 100%;
}

#elettro-preventivi-edit .edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
    flex-wrap: wrap;
    gap: 15px;
}

#elettro-preventivi-edit .edit-header h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 600;
    color: #222;
    display: flex;
    align-items: center;
    gap: 12px;
}

#elettro-preventivi-edit .back-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

#elettro-preventivi-edit .back-link:hover {
    color: #005177;
}

/* Action Buttons Bar */
#elettro-preventivi-edit .quote-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 100%);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 25px;
}

#elettro-preventivi-edit .quote-actions-bar .action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#elettro-preventivi-edit .quote-actions-bar .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#elettro-preventivi-edit .quote-actions-bar .action-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

#elettro-preventivi-edit .action-btn.btn-pdf {
    background: linear-gradient(135deg, #d63638 0%, #b32d2e 100%);
    color: #fff;
}

#elettro-preventivi-edit .action-btn.btn-email {
    background: linear-gradient(135deg, #dba617 0%, #c49410 100%);
    color: #fff;
}

#elettro-preventivi-edit .action-btn.btn-convert {
    background: linear-gradient(135deg, #2271b1 0%, #1a5a8e 100%);
    color: #fff;
}

#elettro-preventivi-edit .action-btn.btn-print {
    background: linear-gradient(135deg, #50575e 0%, #3c4146 100%);
    color: #fff;
}

#elettro-preventivi-edit .action-btn.btn-save {
    background: linear-gradient(135deg, #0a7e50 0%, #086942 100%);
    color: #fff;
}

/* Grid Layout */
#elettro-preventivi-edit .edit-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 25px;
}

@media (max-width: 1024px) {
    #elettro-preventivi-edit .edit-grid {
        grid-template-columns: 1fr;
    }
}

/* Boxes */
#elettro-preventivi-edit .edit-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 25px;
    overflow: visible;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Header needs overflow hidden for rounded corners */
#elettro-preventivi-edit .edit-box > .edit-box-header:first-child {
    border-radius: 8px 8px 0 0;
}

#elettro-preventivi-edit .edit-box-header {
    padding: 14px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

#elettro-preventivi-edit .edit-box-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

#elettro-preventivi-edit .edit-box-body {
    padding: 20px;
}

/* Add Product Section */
#elettro-preventivi-edit .add-product-section {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    padding: 18px;
    background: #f8faf9;
    border: 2px dashed #0a7e50;
    border-radius: 8px;
    margin-bottom: 20px;
}

#elettro-preventivi-edit .add-product-section .field-group {
    flex: 1;
    min-width: 200px;
}

#elettro-preventivi-edit .add-product-section .field-group.qty,
#elettro-preventivi-edit .add-product-section .field-group.price {
    flex: 0 0 100px;
    min-width: 80px;
}

#elettro-preventivi-edit .add-product-section label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 12px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

#elettro-preventivi-edit .add-product-section input,
#elettro-preventivi-edit .add-product-section select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

#elettro-preventivi-edit .add-product-section .btn-add {
    padding: 12px 24px;
    background: #0a7e50;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

#elettro-preventivi-edit .add-product-section .btn-add:hover {
    background: #086942;
}

/* Products Table in Edit */
#elettro-preventivi-edit .products-table {
    width: 100%;
    border-collapse: collapse;
}

#elettro-preventivi-edit .products-table th,
#elettro-preventivi-edit .products-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

#elettro-preventivi-edit .products-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
}

#elettro-preventivi-edit .products-table .product-thumb {
    width: 50px;
}

#elettro-preventivi-edit .products-table .product-thumb img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

#elettro-preventivi-edit .products-table .col-price,
#elettro-preventivi-edit .products-table .col-qty {
    width: 100px;
}

#elettro-preventivi-edit .products-table .col-price input,
#elettro-preventivi-edit .products-table .col-qty input {
    width: 75px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: right;
    font-size: 14px;
}

#elettro-preventivi-edit .products-table .col-total {
    width: 100px;
    text-align: right;
    font-weight: 600;
    color: #0a7e50;
}

#elettro-preventivi-edit .products-table .col-actions {
    width: 80px;
    text-align: center;
}

#elettro-preventivi-edit .products-table .col-actions button {
    padding: 6px 10px;
    margin: 0 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #f0f0f0;
    color: #666;
    transition: all 0.2s;
}

#elettro-preventivi-edit .products-table .col-actions button:hover {
    background: #e0e0e0;
}

#elettro-preventivi-edit .products-table .col-actions .btn-remove {
    color: #b32d2e;
}

#elettro-preventivi-edit .products-table .col-actions .btn-remove:hover {
    background: #fee;
    color: #a00;
}

#elettro-preventivi-edit .products-table tfoot td {
    font-size: 14px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    padding: 8px 12px;
}

#elettro-preventivi-edit .products-table tfoot .quote-total-row td {
    font-size: 16px;
    font-weight: bold;
    border-top: 2px solid #2271b1;
    background: #f0f6fc;
}

/* Form Fields */
#elettro-preventivi-edit .form-row {
    margin-bottom: 18px;
}

#elettro-preventivi-edit .form-row:last-child {
    margin-bottom: 0;
}

#elettro-preventivi-edit .form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #444;
    font-size: 13px;
}

#elettro-preventivi-edit .form-row input[type="text"],
#elettro-preventivi-edit .form-row input[type="email"],
#elettro-preventivi-edit .form-row input[type="tel"],
#elettro-preventivi-edit .form-row input[type="number"],
#elettro-preventivi-edit .form-row input[type="date"],
#elettro-preventivi-edit .form-row select,
#elettro-preventivi-edit .form-row textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#elettro-preventivi-edit .form-row input:focus,
#elettro-preventivi-edit .form-row select:focus,
#elettro-preventivi-edit .form-row textarea:focus {
    border-color: #0a7e50;
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 126, 80, 0.1);
}

/* Two column fields */
#elettro-preventivi-edit .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

#elettro-preventivi-edit .form-grid .full-width {
    grid-column: span 2;
}

@media (max-width: 600px) {
    #elettro-preventivi-edit .form-grid {
        grid-template-columns: 1fr;
    }
    #elettro-preventivi-edit .form-grid .full-width {
        grid-column: span 1;
    }
}

/* Status Dropdown */
#elettro-preventivi-edit .status-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

/* Info section */
#elettro-preventivi-edit .quote-info p {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #666;
}

#elettro-preventivi-edit .quote-info p:last-child {
    margin-bottom: 0;
}

#elettro-preventivi-edit .quote-info strong {
    color: #333;
}

/* Save Button */
#elettro-preventivi-edit .save-section {
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

#elettro-preventivi-edit .save-section .btn-save-main {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #0a7e50 0%, #086942 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(10, 126, 80, 0.3);
}

#elettro-preventivi-edit .save-section .btn-save-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(10, 126, 80, 0.4);
}

#elettro-preventivi-edit .save-section .btn-save-main .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Select2 styling */
#elettro-preventivi-edit .select2-container {
    width: 100% !important;
}

#elettro-preventivi-edit .select2-container--default .select2-selection--single {
    height: 42px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

#elettro-preventivi-edit .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
    padding-left: 14px;
    font-size: 14px;
}

#elettro-preventivi-edit .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

/* Toast notifications */
.elettro-toast {
    position: fixed;
    top: 100px;
    right: 30px;
    padding: 16px 28px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.elettro-toast.success {
    background: linear-gradient(135deg, #7ad03a 0%, #5fa82d 100%);
}

.elettro-toast.error {
    background: linear-gradient(135deg, #d63638 0%, #b32d2e 100%);
}

.elettro-toast.info {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading state */
.elettro-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.elettro-loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #ddd;
    border-top-color: #0a7e50;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    #elettro-preventivi-wrap .preventivi-header {
        flex-direction: column;
        align-items: flex-start;
    }

    #elettro-preventivi-wrap ul.preventivi-status-filter li {
        display: block;
        margin-bottom: 8px;
    }

    #elettro-preventivi-wrap ul.preventivi-status-filter li:after {
        content: "";
        margin: 0;
    }

    #elettro-preventivi-wrap .table th,
    #elettro-preventivi-wrap .table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    #elettro-preventivi-wrap #preventivi-search {
        max-width: 100%;
    }

    #elettro-preventivi-edit .quote-actions-bar {
        justify-content: center;
    }

    #elettro-preventivi-edit .quote-actions-bar .action-btn {
        flex: 1;
        min-width: 140px;
        justify-content: center;
    }
}

/* WooCommerce info/error boxes */
#elettro-preventivi-wrap .woocommerce-info,
#elettro-preventivi-wrap .woocommerce-error {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
}

#elettro-preventivi-wrap .woocommerce-info {
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
}

#elettro-preventivi-wrap .woocommerce-error {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
}

#elettro-preventivi-wrap .woocommerce-info .button,
#elettro-preventivi-wrap .woocommerce-error .button {
    display: inline-block;
    padding: 8px 16px;
    background: #0a7e50;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    margin-right: 10px;
}

/* ============================================
   SIDEBAR NAVIGATION - YITH Style
   ============================================ */

/* Layout with sidebar */
#elettro-preventivi-wrap.with-sidebar {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Sidebar */
.elettro-prev-sidebar {
    flex: 0 0 250px;
    min-width: 250px;
}

/* Main content when sidebar present */
#elettro-preventivi-wrap.with-sidebar .elettro-prev-main-content {
    flex: 1;
    min-width: 0;
}

/* Navigation wrapper */
.elettro-prev-navigation {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Navigation menu */
.elettro-prev-nav-menu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.elettro-prev-nav-menu .nav-item {
    margin: 0;
    border-bottom: 1px solid #f0f0f0;
}

.elettro-prev-nav-menu .nav-item:last-child {
    border-bottom: none;
}

.elettro-prev-nav-menu .nav-item > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.elettro-prev-nav-menu .nav-item > a:hover {
    background: #f8f9fa;
    color: #0a7e50;
}

.elettro-prev-nav-menu .nav-item.is-active > a {
    background: linear-gradient(135deg, #0a7e50 0%, #086942 100%);
    color: #fff;
}

.elettro-prev-nav-menu .nav-item > a .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.elettro-prev-nav-menu .nav-item.is-active > a .dashicons {
    opacity: 1;
}

/* Submenu */
.elettro-prev-nav-menu .nav-submenu {
    margin: 0;
    padding: 0;
    list-style: none;
    background: #f8f9fa;
    border-top: 1px solid #f0f0f0;
}

.elettro-prev-nav-menu .nav-submenu li {
    margin: 0;
}

.elettro-prev-nav-menu .nav-submenu li a {
    display: block;
    padding: 10px 18px 10px 48px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.elettro-prev-nav-menu .nav-submenu li a:hover {
    background: #f0f2f5;
    color: #0a7e50;
    border-left-color: #0a7e50;
}

.elettro-prev-nav-menu .nav-submenu li.is-active a {
    background: #e8f5e9;
    color: #0a7e50;
    font-weight: 600;
    border-left-color: #0a7e50;
}

/* Responsive sidebar */
@media (max-width: 992px) {
    #elettro-preventivi-wrap.with-sidebar {
        flex-direction: column;
    }

    .elettro-prev-sidebar {
        flex: 0 0 auto;
        min-width: 100%;
        width: 100%;
        margin-bottom: 20px;
    }

    .elettro-prev-nav-menu {
        display: flex;
        flex-wrap: wrap;
    }

    .elettro-prev-nav-menu .nav-item {
        flex: 1;
        min-width: 150px;
        border-bottom: none;
        border-right: 1px solid #f0f0f0;
    }

    .elettro-prev-nav-menu .nav-item:last-child {
        border-right: none;
    }

    .elettro-prev-nav-menu .nav-submenu {
        display: none;
    }

    .elettro-prev-nav-menu .nav-item.has-submenu.is-active .nav-submenu {
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        z-index: 100;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
}

@media (max-width: 600px) {
    .elettro-prev-nav-menu .nav-item {
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
    }

    .elettro-prev-nav-menu .nav-item > a {
        padding: 12px 16px;
    }
}

/* ============================================
   FILE MANAGER STYLES
   ============================================ */

/* Filemanager wrapper */
.filemanager-wrap {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Breadcrumb */
.filemanager-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    flex-wrap: wrap;
}

.filemanager-breadcrumb .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #666;
}

.filemanager-breadcrumb a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s;
}

.filemanager-breadcrumb a:hover {
    color: #005177;
    text-decoration: underline;
}

.filemanager-breadcrumb .current {
    color: #333;
    font-weight: 600;
}

/* Files Table */
.filemanager-table {
    width: 100%;
    border-collapse: collapse;
}

.filemanager-table th,
.filemanager-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.filemanager-table thead th {
    background: #fafafa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
}

.filemanager-table tbody tr:hover {
    background: #fafbfc;
}

.filemanager-table tbody tr:last-child td {
    border-bottom: none;
}

/* Column widths */
.filemanager-table .col-icon {
    width: 50px;
    text-align: center;
}

.filemanager-table .col-date {
    width: 150px;
}

.filemanager-table .col-size {
    width: 120px;
}

.filemanager-table .col-actions {
    width: 180px;
    text-align: right;
}

/* Icons */
.filemanager-table .col-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #888;
}

.filemanager-table .folder-row .col-icon .dashicons {
    color: #f0c14b;
}

.filemanager-table .file-row .col-icon .dashicons-pdf {
    color: #d63638;
}

.filemanager-table .file-row .col-icon .dashicons-media-archive {
    color: #8b5a00;
}

.filemanager-table .file-row .col-icon .dashicons-desktop {
    color: #2271b1;
}

.filemanager-table .file-row .col-icon .dashicons-format-image {
    color: #0a7e50;
}

/* Folder links */
.filemanager-table .folder-row .col-name a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.filemanager-table .folder-row .col-name a:hover {
    color: #0a7e50;
}

/* File names */
.filemanager-table .file-row .col-name {
    font-weight: 500;
    color: #333;
}

/* Empty folder */
.filemanager-table .empty-folder {
    text-align: center;
    padding: 60px 20px !important;
    color: #888;
    font-size: 16px;
}

.filemanager-table .empty-folder .dashicons {
    display: block;
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin: 0 auto 15px;
    color: #ccc;
}

/* Action buttons */
.filemanager-table .btn-download,
.filemanager-table .btn-open,
.filemanager-table .btn-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-left: 6px;
}

.filemanager-table .btn-download {
    background: linear-gradient(135deg, #0a7e50 0%, #086942 100%);
    color: #fff;
}

.filemanager-table .btn-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(10, 126, 80, 0.3);
    color: #fff;
}

.filemanager-table .btn-download .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.filemanager-table .btn-open {
    background: #f0f0f0;
    color: #333;
}

.filemanager-table .btn-open:hover {
    background: #e0e0e0;
    color: #0a7e50;
}

.filemanager-table .btn-open .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.filemanager-table .btn-info {
    background: #f0f0f0;
    color: #666;
    padding: 8px 10px;
}

.filemanager-table .btn-info:hover {
    background: #e0e0e0;
    color: #333;
}

.filemanager-table .btn-info .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Modal */
.elettro-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.elettro-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.elettro-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #666;
}

.elettro-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.elettro-modal-content h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #222;
}

/* File info table */
.fileinfo-table {
    width: 100%;
    border-collapse: collapse;
}

.fileinfo-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.fileinfo-table tr:last-child {
    border-bottom: none;
}

.fileinfo-table th,
.fileinfo-table td {
    padding: 12px 0;
    font-size: 14px;
    text-align: left;
}

.fileinfo-table th {
    width: 120px;
    color: #666;
    font-weight: 500;
}

.fileinfo-table td {
    color: #333;
    word-break: break-all;
}

.fileinfo-table .hash-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 4px;
    color: #555;
}

/* Responsive filemanager */
@media (max-width: 768px) {
    .filemanager-table .col-date,
    .filemanager-table thead .col-size {
        display: none;
    }

    .filemanager-table th,
    .filemanager-table td {
        padding: 10px 12px;
    }

    .filemanager-table .btn-download {
        padding: 8px 12px;
        font-size: 12px;
    }

    .filemanager-table .btn-download span:not(.dashicons) {
        display: none;
    }

    .filemanager-table .col-actions {
        width: auto;
    }
}

@media (max-width: 480px) {
    .filemanager-breadcrumb {
        font-size: 13px;
        padding: 12px 14px;
    }

    .elettro-modal-content {
        padding: 20px;
    }

    .elettro-modal-content h3 {
        font-size: 18px;
    }
}

/* ============================================
   PRODUCTS CATALOG STYLES
   ============================================ */

/* Catalog filters */
.catalog-filters {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.catalog-search-form .filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.catalog-filters .filter-search {
    flex: 1;
    min-width: 200px;
}

.catalog-filters .filter-category {
    flex: 0 0 250px;
}

.catalog-filters .search-input,
.catalog-filters .category-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.catalog-filters .btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    background: #0a7e50;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.catalog-filters .btn-filter:hover {
    background: #086942;
}

.catalog-filters .btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.catalog-filters .btn-reset:hover {
    background: #e0e0e0;
    color: #333;
}

.catalog-filters .quick-filters {
    width: 100%;
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.catalog-filters .quick-filter {
    font-size: 13px;
    color: #0073aa;
    text-decoration: none;
}

.catalog-filters .quick-filter:hover {
    text-decoration: underline;
}

/* Catalog filters - Mobile responsive */
@media (max-width: 768px) {
    .catalog-search-form .filter-row {
        flex-direction: column;
        gap: 10px;
    }

    .catalog-filters .filter-search,
    .catalog-filters .filter-category {
        flex: none;
        width: 100%;
        min-width: 0;
    }

    .catalog-filters .search-input,
    .catalog-filters .category-select {
        font-size: 16px;
        padding: 14px 12px;
    }

    .catalog-filters .btn-filter,
    .catalog-filters .btn-reset {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        padding: 14px 20px;
    }

    .catalog-filters .quick-filters {
        flex-wrap: wrap;
    }
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.product-card .product-image {
    position: relative;
    padding-top: 100%;
    background: #f8f8f8;
}

.product-card .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.product-card .out-of-stock-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    background: #d63638;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}

.product-card .product-info {
    padding: 15px;
    flex: 1;
}

.product-card .product-sku {
    font-size: 11px;
    color: #888;
    margin-bottom: 5px;
}

.product-card .product-sku .sku-label {
    font-weight: 600;
}

.product-card .product-title {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-price {
    font-size: 16px;
    font-weight: 700;
    color: #0a7e50;
    margin-bottom: 8px;
}

.product-card .product-price del {
    color: #999;
    font-weight: 400;
    font-size: 13px;
}

.product-card .product-categories {
    font-size: 12px;
    color: #666;
}

.product-card .product-actions {
    display: flex;
    gap: 8px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.product-card .btn-view,
.product-card .btn-add-to-quote {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.product-card .btn-view {
    background: #f0f0f0;
    color: #666;
}

.product-card .btn-view:hover {
    background: #e0e0e0;
    color: #333;
}

.product-card .btn-add-to-quote {
    background: #0a7e50;
    color: #fff;
}

.product-card .btn-add-to-quote:hover {
    background: #086942;
}

.product-card .btn-view .dashicons,
.product-card .btn-add-to-quote .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* No products */
.no-products {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.no-products .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

.no-products p {
    color: #666;
    margin-bottom: 20px;
}

/* Products count */
.preventivi-header .products-count {
    font-size: 14px;
    color: #666;
    font-weight: 400;
}

/* ============================================
   USER PRODUCTS STYLES
   ============================================ */

.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: #e8f4fd;
    border-left: 4px solid #2271b1;
    border-radius: 0 6px 6px 0;
    margin-bottom: 25px;
}

.info-box .dashicons {
    color: #2271b1;
    flex-shrink: 0;
}

.info-box p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.status-draft {
    background: #fff3cd;
    color: #856404;
}

/* Product image upload */
.product-image-upload {
    text-align: center;
}

.product-image-upload .image-preview {
    width: 100%;
    height: 200px;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.product-image-upload .image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-image-upload .image-preview .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #ccc;
    margin-bottom: 10px;
}

.product-image-upload .image-preview .upload-text {
    color: #888;
    font-size: 14px;
}

.product-image-upload .image-preview .remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: #d63638;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-upload .btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.product-image-upload .btn-upload:hover {
    background: #e0e0e0;
}

/* Description text */
.form-row .description {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

/* ============================================
   DASHBOARD STYLES
   ============================================ */

/* Welcome box */
.dashboard-welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, #0a7e50 0%, #086942 100%);
    border-radius: 10px;
    margin-bottom: 25px;
    color: #fff;
}

.dashboard-welcome .welcome-content h3,
#elettro-preventivi-wrap .dashboard-welcome .welcome-content h3,
.dashboard-welcome h3,
#elettro-preventivi-wrap .dashboard-welcome h3 {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 600;
    color: #fff !important;
    color: white !important;
}

.dashboard-welcome .welcome-content p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    max-width: 600px;
}

.dashboard-welcome .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: #fff;
    color: #0a7e50;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.dashboard-welcome .btn-primary:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

/* Stats cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    background: #f0f0f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card .stat-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #666;
}

.stat-card.stat-total .stat-icon { background: #e3f2fd; }
.stat-card.stat-total .stat-icon .dashicons { color: #1976d2; }

.stat-card.stat-pending .stat-icon { background: #fff3e0; }
.stat-card.stat-pending .stat-icon .dashicons { color: #f57c00; }

.stat-card.stat-accepted .stat-icon { background: #e8f5e9; }
.stat-card.stat-accepted .stat-icon .dashicons { color: #388e3c; }

.stat-card.stat-rate .stat-icon { background: #f3e5f5; }
.stat-card.stat-rate .stat-icon .dashicons { color: #7b1fa2; }

.stat-card .stat-content {
    display: flex;
    flex-direction: column;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #222;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #666;
}

/* Value stats */
.dashboard-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.value-card {
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
}

.value-card h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.value-card .value-amount {
    font-size: 22px;
    font-weight: 700;
    color: #222;
}

.value-card.value-accepted .value-amount { color: #388e3c; }
.value-card.value-pending .value-amount { color: #f57c00; }

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.dashboard-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.dashboard-box.full-width {
    grid-column: span 2;
}

.dashboard-box .box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.dashboard-box .box-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.dashboard-box .box-header .view-all {
    font-size: 13px;
    color: #0073aa;
    text-decoration: none;
}

.dashboard-box .box-content {
    padding: 20px;
}

/* Mini table */
.mini-table {
    width: 100%;
    border-collapse: collapse;
}

.mini-table td {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.mini-table tr:last-child td {
    border-bottom: none;
}

.mini-table .col-number a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.mini-table .col-total {
    text-align: right;
    font-weight: 600;
}

.mini-table .col-status {
    width: 20px;
    text-align: right;
}

/* Status dots */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
}

.status-dot.status-ywraq-new { background: #2196f3; }
.status-dot.status-ywraq-pending { background: #ff9800; }
.status-dot.status-ywraq-expired { background: #9e9e9e; }
.status-dot.status-ywraq-accepted { background: #4caf50; }
.status-dot.status-ywraq-rejected { background: #f44336; }
.status-dot.status-new { background: #2196f3; }
.status-dot.status-pending { background: #ff9800; }
.status-dot.status-expired { background: #9e9e9e; }
.status-dot.status-accepted { background: #4caf50; }
.status-dot.status-rejected { background: #f44336; }

/* Quick links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.quick-link:hover {
    background: #e8f5e9;
    border-color: #0a7e50;
    color: #0a7e50;
}

.quick-link .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #666;
}

.quick-link:hover .dashicons {
    color: #0a7e50;
}

.quick-link .link-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.quick-link .link-count {
    background: #0a7e50;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

/* Status breakdown */
.status-breakdown {
    display: grid;
    gap: 15px;
}

.status-item {
    display: grid;
    grid-template-columns: 150px 1fr 60px;
    align-items: center;
    gap: 15px;
}

.status-item .status-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.status-item .status-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.status-item .status-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.status-bar-fill.status-new { background: #2196f3; }
.status-bar-fill.status-pending { background: #ff9800; }
.status-bar-fill.status-expired { background: #9e9e9e; }
.status-bar-fill.status-accepted { background: #4caf50; }
.status-bar-fill.status-rejected { background: #f44336; }

.status-item .status-count {
    font-weight: 600;
    text-align: right;
}

.status-item .status-percentage {
    font-size: 13px;
    color: #666;
    text-align: right;
}

/* Help section */
.dashboard-help {
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
}

.dashboard-help h4 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.help-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.help-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.help-step .step-number {
    width: 40px;
    height: 40px;
    background: #0a7e50;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.help-step .step-content h5 {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 600;
}

.help-step .step-content p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.no-data {
    color: #888;
    font-style: italic;
    text-align: center;
}

/* ============================================
   REPORTS STYLES
   ============================================ */

/* Report filters */
.report-filters {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.date-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 15px;
}

.date-filter-form .filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.date-filter-form label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
}

.date-filter-form input[type="date"] {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.date-filter-form .quick-filters {
    display: flex;
    gap: 15px;
    margin-left: auto;
}

/* Report summary */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.summary-card.success {
    border-color: #4caf50;
    background: #f1f8e9;
}

.summary-card .summary-icon {
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-card .summary-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #666;
}

.summary-card.success .summary-icon {
    background: #c8e6c9;
}

.summary-card.success .summary-icon .dashicons {
    color: #2e7d32;
}

.summary-card .summary-data {
    display: flex;
    flex-direction: column;
}

.summary-card .summary-value {
    font-size: 18px;
    font-weight: 700;
    color: #222;
}

.summary-card .summary-label {
    font-size: 12px;
    color: #666;
}

/* Report grid */
.report-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 25px;
}

.report-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.report-box.full-width {
    grid-column: span 2;
}

/* Charts */
.status-chart,
.value-chart {
    display: grid;
    gap: 12px;
}

.chart-item,
.value-item {
    display: grid;
    grid-template-columns: 120px 1fr 100px;
    align-items: center;
    gap: 12px;
}

.chart-label,
.value-label {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-bar-wrap,
.value-bar-wrap {
    height: 12px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
}

.chart-bar,
.value-bar {
    height: 100%;
    border-radius: 6px;
}

.chart-bar.status-new { background: #2196f3; }
.chart-bar.status-pending { background: #ff9800; }
.chart-bar.status-expired { background: #9e9e9e; }
.chart-bar.status-accepted { background: #4caf50; }
.chart-bar.status-rejected { background: #f44336; }

.value-bar.value-accepted { background: #4caf50; }
.value-bar.value-pending { background: #ff9800; }
.value-bar.value-rejected { background: #f44336; }

.chart-value,
.value-amount {
    font-size: 13px;
    text-align: right;
    color: #555;
}

/* Report table */
.report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-table th,
.report-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.report-table th {
    background: #fafafa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #555;
}

.report-table tbody tr:hover {
    background: #fafafa;
}

/* Rate badge */
.rate-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.rate-badge.good {
    background: #e8f5e9;
    color: #2e7d32;
}

.rate-badge.medium {
    background: #fff3e0;
    color: #ef6c00;
}

.rate-badge.low {
    background: #ffebee;
    color: #c62828;
}

/* Export */
.report-export {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.report-export p {
    margin: 0;
    font-size: 14px;
    color: #555;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #0a7e50;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-export:hover {
    background: #086942;
    color: #fff;
}

/* Responsive Dashboard & Reports */
@media (max-width: 992px) {
    .dashboard-welcome {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .dashboard-grid,
    .report-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-box.full-width,
    .report-box.full-width {
        grid-column: span 1;
    }

    .dashboard-values {
        grid-template-columns: 1fr;
    }

    .help-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .quick-links {
        grid-template-columns: 1fr;
    }

    .help-steps {
        grid-template-columns: 1fr;
    }

    .status-item,
    .chart-item,
    .value-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .status-item .status-bar,
    .chart-bar-wrap,
    .value-bar-wrap {
        width: 100%;
    }

    .report-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .date-filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .date-filter-form .quick-filters {
        margin-left: 0;
        flex-wrap: wrap;
    }
}

/* Products grid & card - Tablet */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-card .btn-view,
    .product-card .btn-add-to-quote {
        min-height: 44px;
        padding: 12px 8px;
        font-size: 13px;
    }

    .product-card .product-sku {
        font-size: 12px;
    }

    .product-card .product-categories {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-card .product-info {
        padding: 10px;
    }

    .product-card .product-title {
        font-size: 13px;
    }

    .product-card .product-price {
        font-size: 14px;
    }

    .product-card .product-actions {
        flex-direction: column;
        gap: 6px;
        padding: 10px;
    }

    .product-card .btn-view,
    .product-card .btn-add-to-quote {
        min-height: 44px;
    }

    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
    }

    .report-summary {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   STATUS BADGES / MARKS
   ============================================ */

/* Status mark badges */
mark.ywraq-new,
mark.ywraq-pending,
mark.ywraq-expired,
mark.ywraq-accepted,
mark.ywraq-rejected,
.elettro-prev-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
    background: #e0e0e0;
    color: #333;
}

/* New - Blue */
mark.ywraq-new,
.elettro-prev-status--ywraq-new {
    background: #e3f2fd;
    color: #1565c0;
}

/* Pending - Orange */
mark.ywraq-pending,
.elettro-prev-status--ywraq-pending {
    background: #fff3e0;
    color: #e65100;
}

/* Expired - Gray */
mark.ywraq-expired,
.elettro-prev-status--ywraq-expired {
    background: #f5f5f5;
    color: #616161;
}

/* Accepted - Green */
mark.ywraq-accepted,
.elettro-prev-status--ywraq-accepted {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Rejected - Red */
mark.ywraq-rejected,
.elettro-prev-status--ywraq-rejected {
    background: #ffebee;
    color: #c62828;
}

/* Status dots for lists */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.status-ywraq-new { background: #1565c0; }
.status-dot.status-ywraq-pending { background: #e65100; }
.status-dot.status-ywraq-expired { background: #616161; }
.status-dot.status-ywraq-accepted { background: #2e7d32; }
.status-dot.status-ywraq-rejected { background: #c62828; }

/* Edit header status mark */
#elettro-preventivi-edit .edit-header mark {
    vertical-align: middle;
    margin-left: 10px;
}

/* Download button */
.quote-actions-bar .btn-download {
    background: #5e35b1;
    color: #fff;
}

.quote-actions-bar .btn-download:hover {
    background: #4527a0;
}

/* ============================================
   CUSTOM FIELDS STYLING
   ============================================ */

/* Field hints */
#elettro-preventivi-wrap .field-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Attachments section */
#elettro-prev-attachments {
    margin-bottom: 15px;
}

#elettro-prev-attachments .attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

#elettro-prev-attachments .attachment-item input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
}

#elettro-prev-attachments .attachment-item .btn-view,
#elettro-prev-attachments .attachment-item .btn-remove-attachment {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

#elettro-prev-attachments .attachment-item .btn-view {
    background: #e3f2fd;
    color: #1565c0;
    text-decoration: none;
}

#elettro-prev-attachments .attachment-item .btn-view:hover {
    background: #bbdefb;
}

#elettro-prev-attachments .attachment-item .btn-remove-attachment {
    background: #ffebee;
    color: #c62828;
}

#elettro-prev-attachments .attachment-item .btn-remove-attachment:hover {
    background: #ffcdd2;
}

#elettro-prev-add-attachment {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px dashed #bbb;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: all 0.2s;
}

#elettro-prev-add-attachment:hover {
    background: #e8f5e9;
    border-color: #0a7e50;
    color: #0a7e50;
}

#elettro-prev-add-attachment .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Form grid for manodopera section */
#elettro-preventivi-wrap .edit-box .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    #elettro-preventivi-wrap .edit-box .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Select styling for IVA */
#elettro-preventivi-wrap select[name="custom_tax_rate"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

#elettro-preventivi-wrap select[name="custom_tax_rate"]:focus {
    border-color: #0a7e50;
    outline: none;
}

/* Input number for prezzo a corpo */
#elettro-preventivi-wrap input[name="order_pay_per_body"] {
    width: 100%;
}

/* Media uploader modal override */
.media-modal .media-menu-item {
    padding: 8px 20px;
}

/* ============================================
   REPORT PAGE FIXES
   ============================================ */

/* Report box header and content */
.report-box .box-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.report-box .box-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.report-box .box-content {
    padding: 20px;
}

/* Filter button */
.report-filters .btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #0a7e50;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.report-filters .btn-filter:hover {
    background: #086942;
}

.report-filters .btn-filter .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Quick filters */
.report-filters .quick-filters {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.report-filters .quick-filter {
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 12px;
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
}

.report-filters .quick-filter:hover {
    background: #0a7e50;
    color: #fff;
    border-color: #0a7e50;
}

/* Export section */
.report-export {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.report-export p {
    margin: 0 0 15px 0;
    color: #666;
}

.report-export .btn-export {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #0a7e50;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
}

.report-export .btn-export:hover {
    background: #086942;
    color: #fff;
}

/* Chart improvements */
.chart-value,
.value-amount {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-align: right;
}

/* Status dots for charts */
.status-dot.status-new { background: #2196f3; }
.status-dot.status-pending { background: #ff9800; }
.status-dot.status-expired { background: #9e9e9e; }
.status-dot.status-accepted { background: #4caf50; }
.status-dot.status-rejected { background: #f44336; }

/* Table improvements */
.report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-table th {
    background: #0a7e50;
    color: #fff;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
}

.report-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #333;
}

.report-table tbody tr:hover {
    background: #f8f9fa;
}

/* Rate badges */
.rate-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.rate-badge.good {
    background: #e8f5e9;
    color: #2e7d32;
}

.rate-badge.medium {
    background: #fff3e0;
    color: #e65100;
}

.rate-badge.low {
    background: #ffebee;
    color: #c62828;
}

/* Summary card value fix for WooCommerce price */
.summary-card .summary-value .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

/* Mobile fixes for reports */
@media (max-width: 768px) {
    .date-filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .report-filters .quick-filters {
        margin-left: 0;
        margin-top: 10px;
        flex-wrap: wrap;
    }

    .chart-item,
    .value-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .chart-value,
    .value-amount {
        text-align: left;
    }

    .report-table {
        font-size: 12px;
    }

    .report-table th,
    .report-table td {
        padding: 8px 10px;
    }
}

/* ============================================
   ORDER STATUS MARKS
   ============================================ */
#elettro-preventivi-wrap mark[class*="order-status-"] {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
    background: #e0e0e0;
    color: #333;
}

#elettro-preventivi-wrap mark.order-status-processing {
    background: #c6e1c6;
    color: #5b841b;
}

#elettro-preventivi-wrap mark.order-status-completed {
    background: #c8d7e1;
    color: #2e4453;
}

#elettro-preventivi-wrap mark.order-status-on-hold {
    background: #f8dda7;
    color: #94660c;
}

#elettro-preventivi-wrap mark.order-status-pending {
    background: #e5e5e5;
    color: #777;
}

#elettro-preventivi-wrap mark.order-status-cancelled,
#elettro-preventivi-wrap mark.order-status-refunded,
#elettro-preventivi-wrap mark.order-status-failed {
    background: #eba3a3;
    color: #761919;
}

/* ========================================
   GUIDE PAGE STYLES
   ======================================== */

/* Table of Contents */
.guide-toc {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px 30px;
    margin-bottom: 30px;
}

.guide-toc h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.guide-toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
    columns: 2;
    column-gap: 30px;
}

.guide-toc ul li {
    padding: 5px 0;
}

.guide-toc ul li a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s;
}

.guide-toc ul li a:hover {
    color: #005177;
    text-decoration: underline;
}

/* Guide Sections */
.guide-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 25px;
    overflow: hidden;
}

.guide-section h3 {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff !important;
    margin: 0;
    padding: 15px 20px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.guide-section h3 .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.guide-content {
    padding: 20px;
}

.guide-content p {
    margin-bottom: 15px;
    line-height: 1.7;
    color: #555;
}

/* Guide Features List */
.guide-features h4 {
    margin: 20px 0 10px 0;
    color: #333;
}

.guide-features ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.guide-features ul li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.guide-features ul li .dashicons-yes {
    color: #46b450;
}

/* Guide Box */
.guide-box {
    background: #f8f9fa;
    border-left: 4px solid #28a745;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 0 8px 8px 0;
}

.guide-box h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 15px;
}

.guide-box ul,
.guide-box ol {
    margin: 0;
    padding-left: 20px;
}

.guide-box ul li,
.guide-box ol li {
    padding: 5px 0;
    color: #555;
}

.guide-box ul li .dashicons {
    color: #28a745;
    margin-right: 5px;
}

/* Guide Steps */
.guide-steps {
    margin: 20px 0;
}

.guide-step {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e0e0e0;
}

.guide-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.step-content h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
}

.step-content p {
    margin: 0 0 10px 0;
    color: #555;
}

.step-content ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.step-content ul li {
    padding: 3px 0;
    color: #555;
}

/* Guide Tips */
.guide-tip {
    background: #fff8e5;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 15px;
    margin: 15px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.guide-tip .dashicons-lightbulb {
    color: #ffc107;
    flex-shrink: 0;
}

.guide-tip strong {
    color: #856404;
}

/* Status Dots in Guide */
.guide-content .status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

.guide-content .status-dot.status-new {
    background: #73a9fd;
}

.guide-content .status-dot.status-pending {
    background: #ffba00;
}

.guide-content .status-dot.status-accepted {
    background: #46b450;
}

.guide-content .status-dot.status-rejected {
    background: #dc3545;
}

.guide-content .status-dot.status-expired {
    background: #6c757d;
}

.guide-content .status-dot.status-processing {
    background: #c6e1c6;
}

.guide-content .status-dot.status-completed {
    background: #46b450;
}

.guide-content .status-dot.status-cancelled {
    background: #dc3545;
}

/* FAQ Styles */
.faq-list {
    margin: 0;
}

.faq-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-question {
    margin: 0;
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #333;
    transition: background 0.2s;
}

.faq-question:hover {
    background: #e9ecef;
}

.faq-question .dashicons {
    color: #28a745;
    transition: transform 0.2s;
}

.faq-item.is-open .faq-question .dashicons {
    transform: rotate(90deg);
}

.faq-answer {
    display: none;
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

.faq-item.is-open .faq-answer {
    display: block;
}

.faq-answer p {
    margin: 0;
    color: #555;
    line-height: 1.7;
}

/* Support Section */
.guide-support {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
}

.guide-support h3 {
    background: transparent;
}

.guide-support .guide-content {
    color: #fff;
}

.guide-support .guide-content p {
    color: rgba(255,255,255,0.9);
}

.support-contacts {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.support-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.support-item .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.support-item a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 18px;
}

.support-item a:hover {
    text-decoration: underline;
}

/* Responsive Guide */
@media (max-width: 768px) {
    .guide-toc ul {
        columns: 1;
    }

    .guide-step {
        flex-direction: column;
    }

    .step-number {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .support-contacts {
        flex-direction: column;
        gap: 15px;
    }
}

/* ========================================
   TOOLTIPS STYLES
   ======================================== */

.elettro-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    vertical-align: middle;
}

.elettro-tooltip .tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #c0c0c0;
    color: #555;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    margin-left: 5px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.elettro-tooltip:hover .tooltip-icon {
    background: #28a745;
    color: #fff;
}

/* Ensure tooltips are visible outside parent containers */
.edit-box,
.edit-box-header,
.edit-box-body,
.form-row,
.form-grid,
.field-group,
.add-product-section {
    overflow: visible !important;
}

.elettro-tooltip .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 999999;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.5;
    width: 280px;
    max-width: 320px;
    text-align: left;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    transition: all 0.2s;
    pointer-events: none;
}

.elettro-tooltip .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #333;
}

.elettro-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Tooltip on left */
.elettro-tooltip.tooltip-left .tooltip-text {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.elettro-tooltip.tooltip-left .tooltip-text::after {
    left: auto;
    right: 20px;
    transform: translateX(0);
}

/* Tooltip below (for headers or when space is limited above) */
.elettro-tooltip.tooltip-below .tooltip-text {
    bottom: auto;
    top: calc(100% + 10px);
}

.elettro-tooltip.tooltip-below .tooltip-text::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #333;
}

/* Tooltip in headers - specific styling */
.edit-box-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-box-header .elettro-tooltip {
    position: relative;
}

/* Header tooltips appear below to avoid being cut off */
.edit-box-header .elettro-tooltip .tooltip-text {
    bottom: auto;
    top: calc(100% + 10px);
    left: 0;
    transform: none;
    white-space: normal;
    min-width: 250px;
}

.edit-box-header .elettro-tooltip .tooltip-text::after {
    top: auto;
    bottom: 100%;
    left: 15px;
    transform: none;
    border-top-color: transparent;
    border-bottom-color: #333;
}

/* Form field tooltips */
.form-field-with-tooltip {
    display: flex;
    align-items: center;
}

.form-field-with-tooltip label {
    display: flex;
    align-items: center;
}

/* Label with tooltip inline */
label .elettro-tooltip {
    margin-left: 3px;
}

/* Tooltips inside add-product-section - appear below */
.add-product-section .elettro-tooltip .tooltip-text {
    bottom: auto;
    top: calc(100% + 8px);
    left: 0;
    transform: none;
    min-width: 220px;
}

.add-product-section .elettro-tooltip .tooltip-text::after {
    top: auto;
    bottom: 100%;
    left: 15px;
    transform: none;
    border-top-color: transparent;
    border-bottom-color: #333;
}

/* Tooltips inside field-group labels */
.field-group .elettro-tooltip .tooltip-text {
    left: 0;
    transform: none;
    min-width: 200px;
}

.field-group .elettro-tooltip .tooltip-text::after {
    left: 15px;
    transform: none;
}

/* Inline help text */
.field-help {
    display: block;
    font-size: 12px;
    color: #777;
    margin-top: 5px;
    font-style: italic;
}

/* Make sure labels can contain tooltips properly */
.form-row label,
.field-group label,
#elettro-preventivi-edit .form-row label,
#elettro-preventivi-edit .field-group label,
#elettro-preventivi-wrap .form-row label,
#elettro-preventivi-wrap .field-group label,
.add-product-section label {
    display: inline-flex !important;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

/* Original Message Box (read-only customer request message) */
.original-message-box {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #28a745;
    border-radius: 6px;
    padding: 15px;
    font-size: 14px;
    color: #444;
    line-height: 1.6;
    font-style: italic;
}

/* ========================================
   GUIDE PAGE - ADDITIONAL STYLES
   ======================================== */

/* Welcome Banner */
.guide-welcome {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px 30px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #a5d6a7;
    border-radius: 12px;
    margin-bottom: 25px;
}

.guide-welcome-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-welcome-icon .dashicons {
    font-size: 30px;
    width: 30px;
    height: 30px;
    color: #fff;
}

.guide-welcome-content h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #2e7d32;
}

.guide-welcome-content p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

/* Quick Start Section */
.guide-quickstart {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
}

.guide-quickstart h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.guide-quickstart h3 .dashicons {
    color: #28a745;
}

.quickstart-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.quickstart-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 25px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.quickstart-card:hover {
    border-color: #28a745;
    background: linear-gradient(135deg, #e8f5e9 0%, #fff 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.15);
}

.quickstart-card .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #28a745;
    margin-bottom: 12px;
}

.quickstart-card .card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.quickstart-card .card-desc {
    font-size: 13px;
    color: #666;
}

/* Table of Contents - 3 Columns */
.toc-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.toc-column h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #28a745;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    border-bottom: 2px solid #28a745;
}

.toc-column ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.toc-column ul li {
    padding: 6px 0;
}

.toc-column ul li a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.toc-column ul li a:hover {
    color: #28a745;
    padding-left: 5px;
}

.toc-column ul li a .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #888;
}

.toc-column ul li a:hover .dashicons {
    color: #28a745;
}

/* Guide Fields Grid */
.guide-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.guide-field {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #28a745;
}

.guide-field .field-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #e8f5e9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-field .field-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #28a745;
}

.guide-field .field-info {
    flex: 1;
}

.guide-field .field-info strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.guide-field .field-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.tip-card {
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.2s;
}

.tip-card:hover {
    border-color: #28a745;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.tip-card .tip-icon {
    display: inline-flex;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.tip-card .tip-icon .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    color: #28a745;
}

.tip-card h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #333;
}

.tip-card p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

/* Status List in Guide */
.status-list {
    display: grid;
    gap: 12px;
}

.status-item-guide {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.status-item-guide .status-badge {
    flex-shrink: 0;
    min-width: 100px;
    text-align: center;
}

.status-item-guide p {
    margin: 0;
    font-size: 14px;
    color: #555;
}

/* Status badges for guide */
.status-badge.status-new {
    background: #e3f2fd;
    color: #1565c0;
}

.status-badge.status-pending {
    background: #fff3e0;
    color: #e65100;
}

.status-badge.status-accepted {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.status-rejected {
    background: #ffebee;
    color: #c62828;
}

.status-badge.status-expired {
    background: #f5f5f5;
    color: #616161;
}

/* Guide Table */
.guide-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.guide-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.guide-table tr:last-child {
    border-bottom: none;
}

.guide-table td {
    padding: 10px 15px;
    font-size: 14px;
}

.guide-table td:first-child {
    width: 80px;
    font-weight: 600;
    color: #28a745;
}

.guide-table td:last-child {
    color: #555;
}

/* Guide Example Box */
.guide-example {
    background: #f0f7ff;
    border: 1px solid #b3d7ff;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 15px 0;
}

.guide-example strong {
    display: block;
    margin-bottom: 10px;
    color: #0066cc;
}

.guide-example ul {
    margin: 0;
    padding-left: 20px;
    color: #555;
}

.guide-example ul li {
    padding: 3px 0;
    font-size: 14px;
    font-style: italic;
}

/* Checklist Style */
.checklist {
    margin: 15px 0;
    padding: 0;
    list-style: none;
}

.checklist li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: #555;
}

.checklist li .dashicons {
    flex-shrink: 0;
    color: #28a745;
    margin-top: 2px;
}

.checklist li .dashicons-marker {
    color: #666;
}

/* Action Buttons */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    color: #fff !important;
}

.btn-action .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.step-action {
    margin-top: 15px;
}

/* Guide Introduction */
.guide-intro {
    font-size: 15px;
    color: #444;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #e0e0e0;
}

/* Guide warning tip */
.guide-tip .dashicons-warning {
    color: #e65100;
}

/* Responsive Guide Additional Styles */
@media (max-width: 992px) {
    .toc-columns {
        grid-template-columns: 1fr 1fr;
    }

    .guide-welcome {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .toc-columns {
        grid-template-columns: 1fr;
    }

    .quickstart-cards {
        grid-template-columns: 1fr;
    }

    .guide-fields-grid {
        grid-template-columns: 1fr;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }

    .status-item-guide {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .guide-welcome {
        padding: 20px;
    }

    .guide-welcome-icon {
        width: 50px;
        height: 50px;
    }

    .guide-welcome-icon .dashicons {
        font-size: 24px;
        width: 24px;
        height: 24px;
    }

    .quickstart-card {
        padding: 20px 15px;
    }
}

/* ================================
   CATALOG TABS STYLES
   ================================ */

.catalog-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e0e0;
}

.catalog-tabs .tab-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.catalog-tabs .tab-link:hover {
    color: #0a7e50;
    background: rgba(10, 126, 80, 0.05);
}

.catalog-tabs .tab-link.active {
    color: #0a7e50;
    border-bottom-color: #0a7e50;
    font-weight: 600;
}

.catalog-tabs .tab-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.catalog-tabs .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: #f0f0f0;
    color: #666;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.catalog-tabs .tab-link.active .tab-count {
    background: #0a7e50;
    color: #fff;
}

/* User Product Card Badge */
.product-card.user-product {
    position: relative;
    border: 2px solid #0a7e50;
}

.product-card .product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #0a7e50 0%, #086942 100%);
    color: #fff;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

.product-card .product-author {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #888;
    margin-top: 8px;
}

.product-card .product-author .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.product-card .price-na {
    color: #999;
    font-style: italic;
    font-size: 13px;
}

/* Responsive Catalog Tabs */
@media (max-width: 768px) {
    .catalog-tabs {
        flex-direction: column;
        gap: 0;
    }

    .catalog-tabs .tab-link {
        border-bottom: none;
        border-left: 2px solid transparent;
        margin-bottom: 0;
        margin-left: -2px;
    }

    .catalog-tabs .tab-link.active {
        border-left-color: #0a7e50;
    }
}

/* ================================
   SELECT DROPDOWN FIX - STATO, PAESE, IVA
   ================================ */

/* Reset base per tutti i select nel form preventivi */
#elettro-preventivi-edit select,
#elettro-preventivi-wrap .edit-box select {
    display: block;
    width: 100%;
    padding: 10px 35px 10px 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#elettro-preventivi-edit select:hover,
#elettro-preventivi-wrap .edit-box select:hover {
    border-color: #0a7e50;
}

#elettro-preventivi-edit select:focus,
#elettro-preventivi-wrap .edit-box select:focus {
    border-color: #0a7e50;
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 126, 80, 0.15);
}

/* Opzioni del dropdown */
#elettro-preventivi-edit select option,
#elettro-preventivi-wrap .edit-box select option {
    padding: 10px 12px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
}

#elettro-preventivi-edit select option:hover,
#elettro-preventivi-wrap .edit-box select option:hover,
#elettro-preventivi-edit select option:checked,
#elettro-preventivi-wrap .edit-box select option:checked {
    background-color: #0a7e50;
    color: #fff;
}

/* Select Stato - nella sidebar */
#elettro-preventivi-edit .edit-sidebar select[name="status"],
#elettro-preventivi-edit select.status-select {
    font-weight: 500;
    padding: 12px 35px 12px 14px;
}

/* Select Paese */
#elettro-preventivi-edit select[name="billing_country"],
#elettro-preventivi-edit select[name="shipping_country"] {
    max-width: 100%;
}

/* Select Aliquota IVA */
#elettro-preventivi-edit select[name="custom_tax_rate"] {
    max-width: 200px;
}

/* Fix per il select dentro form-row */
#elettro-preventivi-edit .form-row select {
    margin-top: 0;
}

/* Forza la visibilità delle opzioni in dropdown */
#elettro-preventivi-edit select option {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Fix per browser specifici */
@supports (-webkit-appearance: none) {
    #elettro-preventivi-edit select,
    #elettro-preventivi-wrap .edit-box select {
        padding-right: 35px;
    }
}

/* Firefox specific fix */
@-moz-document url-prefix() {
    #elettro-preventivi-edit select,
    #elettro-preventivi-wrap .edit-box select {
        text-indent: 0.01px;
        text-overflow: '';
        padding-right: 35px;
    }
}

/* IE/Edge fix */
#elettro-preventivi-edit select::-ms-expand,
#elettro-preventivi-wrap .edit-box select::-ms-expand {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    #elettro-preventivi-edit select[name="custom_tax_rate"] {
        max-width: 100%;
    }
}

/* ================================
   SELECT2 DROPDOWN FIX (se applicato globalmente)
   ================================ */

/* Fix Select2 dropdown container globale */
.select2-container--default .select2-results__option {
    padding: 10px 12px !important;
    font-size: 14px !important;
    color: #333 !important;
    background-color: #fff !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #0a7e50 !important;
    color: #fff !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #f0f0f0 !important;
    color: #333 !important;
}

.select2-dropdown {
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.select2-search--dropdown .select2-search__field {
    padding: 10px 12px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
}

/* Assicura che i select nativi abbiano priorità */
#elettro-preventivi-edit select:not(.wc-product-search):not(.wc-customer-search):not([data-select2-id]),
#elettro-preventivi-edit select[name="status"],
#elettro-preventivi-edit select[name="billing_country"],
#elettro-preventivi-edit select[name="custom_tax_rate"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

/* Fix altezza e visibilità dropdown */
.select2-results {
    max-height: 300px !important;
    overflow-y: auto !important;
}

.select2-results__options {
    max-height: none !important;
}

/* FIX SCROLL PRODOTTI: Forza scroll con mouse wheel nel dropdown ricerca prodotti */
.select2-container.elettro-product-dropdown .select2-results {
    max-height: 300px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
}

.select2-container.elettro-product-dropdown .select2-results__options {
    max-height: none !important;
    overflow: visible !important;
}

/* Fix z-index per dropdown prodotti - deve stare sopra tutto */
.select2-container.elettro-product-dropdown {
    z-index: 999999 !important;
}

.select2-container.elettro-product-dropdown .select2-dropdown {
    z-index: 999999 !important;
}

/* Assicura che il dropdown sia posizionato correttamente */
.select2-container--open .select2-dropdown--below {
    z-index: 999999 !important;
}

/* ================================
   SELECT STATO SIDEBAR - FIX SPECIFICO
   ================================ */

/* Select stato nella sidebar - stili forzati */
#elettro-preventivi-edit .edit-sidebar .edit-box select.status-select,
#elettro-preventivi-edit .edit-sidebar select[name="status"],
#elettro-preventivi-edit #elettro-status-select,
select.native-select {
    display: block !important;
    width: 100% !important;
    padding: 12px 40px 12px 14px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    color: #333 !important;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 14px 10px !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    cursor: pointer !important;
    box-shadow: none !important;
    outline: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

#elettro-preventivi-edit .edit-sidebar select.status-select:hover,
#elettro-preventivi-edit #elettro-status-select:hover {
    border-color: #0a7e50 !important;
}

#elettro-preventivi-edit .edit-sidebar select.status-select:focus,
#elettro-preventivi-edit #elettro-status-select:focus {
    border-color: #0a7e50 !important;
    box-shadow: 0 0 0 3px rgba(10, 126, 80, 0.15) !important;
}

/* Opzioni del select stato */
#elettro-preventivi-edit .edit-sidebar select.status-select option,
#elettro-preventivi-edit #elettro-status-select option {
    padding: 10px 14px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #333 !important;
    background-color: #fff !important;
    line-height: 1.4 !important;
}

/* Sidebar tooltip fix */
.edit-sidebar .elettro-tooltip .tooltip-text {
    left: auto !important;
    right: 0 !important;
    transform: none !important;
    min-width: 250px;
}

.edit-sidebar .elettro-tooltip .tooltip-text::after {
    left: auto !important;
    right: 15px !important;
    transform: none !important;
}

/* Sidebar edit-box overflow fix */
.edit-sidebar .edit-box,
.edit-sidebar .edit-box-header,
.edit-sidebar .edit-box-body {
    overflow: visible !important;
}

/* ============================================
   EMAIL MODAL STYLES
   ============================================ */

.elettro-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.elettro-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.elettro-modal-content h3 {
    padding: 20px 25px;
    margin: 0;
    border-bottom: 1px solid #eee;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.elettro-modal-content h3::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%230a7e50"><path d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>') center/contain no-repeat;
}

.elettro-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.elettro-modal-close:hover {
    color: #333;
}

.elettro-modal-body {
    padding: 25px;
}

.elettro-modal-body .form-row {
    margin-bottom: 0;
}

.elettro-modal-body label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.elettro-modal-body input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.elettro-modal-body input[type="email"]:focus {
    border-color: #0a7e50;
    box-shadow: 0 0 0 3px rgba(10, 126, 80, 0.1);
    outline: none;
}

.elettro-modal-body .field-hint {
    display: block;
    margin-top: 8px;
    color: #777;
    font-size: 13px;
}

.elettro-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    border-radius: 0 0 12px 12px;
}

.elettro-modal-footer .btn-cancel {
    padding: 12px 20px;
    background: #f0f0f0;
    color: #555;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.elettro-modal-footer .btn-cancel:hover {
    background: #e0e0e0;
}

.elettro-modal-footer .btn-send {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #0a7e50;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.elettro-modal-footer .btn-send:hover {
    background: #086942;
}

.elettro-modal-footer .btn-send .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Badge "MIO" per prodotti personalizzati */
.badge-mio {
    display: inline-block;
    padding: 2px 8px;
    background: #17a2b8;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    margin-left: 8px;
    vertical-align: middle;
}

.product-row.user-product {
    background: #f0f9ff !important;
}

/* Full width form row for description */
.form-grid .form-row.full-width {
    grid-column: 1 / -1;
}

/* ============================================
   IMPROVED MOBILE RESPONSIVE STYLES
   ============================================ */

@media (max-width: 1024px) {
    #elettro-preventivi-wrap.with-sidebar {
        flex-direction: column;
    }

    .elettro-prev-sidebar {
        position: relative;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
    }

    .nav-item {
        flex: 1;
        min-width: 100px;
    }

    .nav-link {
        padding: 12px 15px;
        justify-content: center;
        font-size: 13px;
    }

    .nav-link .dashicons {
        margin-right: 5px;
    }

    .nav-link span:not(.dashicons) {
        display: inline;
    }

    .edit-grid {
        grid-template-columns: 1fr !important;
    }

    .edit-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    #elettro-preventivi-wrap {
        padding: 15px;
    }

    .edit-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .edit-header .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .edit-header .header-actions .btn {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }

    .products-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .products-table th,
    .products-table td {
        min-width: 80px;
    }

    .products-table .col-sku {
        display: none;
    }

    .products-table .product-thumb img {
        width: 35px;
        height: 35px;
    }

    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .add-product-section .field-group {
        flex-direction: column;
    }

    .add-product-section .field-group > * {
        width: 100% !important;
    }

    .sidebar-nav .nav-link span:not(.dashicons) {
        display: none;
    }

    .sidebar-nav .nav-link {
        padding: 12px;
    }

    .sidebar-nav .nav-link .dashicons {
        margin-right: 0;
    }

    /* Modal responsive */
    .elettro-modal {
        padding: 10px;
    }

    .elettro-modal-content {
        max-width: 100%;
    }

    .elettro-modal-footer {
        flex-direction: column;
    }

    .elettro-modal-footer .btn-cancel,
    .elettro-modal-footer .btn-send {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .edit-box-header h3 {
        font-size: 14px;
    }

    .edit-box-body {
        padding: 15px;
    }

    .products-table .col-price,
    .products-table .col-qty {
        width: 60px;
    }

    .products-table .col-price input,
    .products-table .col-qty input {
        padding: 6px;
        font-size: 12px;
    }

    .products-table .col-actions .btn-update,
    .products-table .col-actions .btn-remove {
        padding: 6px;
        min-width: 32px;
        min-height: 32px;
    }

    .nav-item {
        min-width: 50px;
        flex: 0 0 auto;
    }
}

/* ============================================
   DEBUG FIX - MOBILE & SELECT IMPROVEMENTS
   ============================================ */

/* ===========================================
   FIX 1: SELECT DROPDOWN VISIBILITY
   =========================================== */

/* Garantire che TUTTI i select siano visibili e funzionanti */
#elettro-preventivi-edit select,
#elettro-preventivi-wrap select,
.elettro-modal select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px !important;
    cursor: pointer;
    min-height: 48px; /* Touch-friendly */
    font-size: 16px !important; /* Prevent zoom on iOS */
}

/* Fix specifico per iOS che non mostra le opzioni */
@supports (-webkit-touch-callout: none) {
    #elettro-preventivi-edit select,
    #elettro-preventivi-wrap select {
        background-color: #fff !important;
    }
}

/* Opzioni dropdown più visibili */
#elettro-preventivi-edit select option,
#elettro-preventivi-wrap select option {
    padding: 12px 16px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    min-height: 44px !important;
}

/* ===========================================
   FIX 2: TOUCH TARGETS - MIN 44px
   =========================================== */

/* Bottoni azioni più grandi per touch */
.quote-actions-bar .action-btn {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 16px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Bottoni nella tabella prodotti */
.products-table .btn-update,
.products-table .btn-remove {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    border-radius: 6px;
}

/* Input nella tabella prodotti */
.products-table input[type="number"] {
    min-height: 44px;
    font-size: 16px !important;
    text-align: center;
}

/* ===========================================
   FIX 3: ACTION BUTTONS BAR RESPONSIVE
   =========================================== */

.quote-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .quote-actions-bar {
        padding: 12px;
        gap: 8px;
    }

    .quote-actions-bar .action-btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        padding: 14px 12px;
        font-size: 13px;
        text-align: center;
        justify-content: center;
    }

    .quote-actions-bar .action-btn .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .quote-actions-bar .action-btn {
        flex: 1 1 100%;
        padding: 16px;
    }
    
    /* Nascondi testo, solo icone su mobile piccolo */
    .quote-actions-bar .action-btn span:not(.dashicons) {
        display: inline; /* Mantieni il testo visibile */
    }
}

/* ===========================================
   FIX 4: TABELLA PRODOTTI MOBILE
   =========================================== */

@media (max-width: 992px) {
    .products-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -15px;
        padding: 0 15px;
    }

    .products-table table {
        min-width: 700px;
    }
}

@media (max-width: 768px) {
    /* Nascondi SKU su mobile */
    .products-table .col-sku,
    .products-table th.col-sku {
        display: none !important;
    }

    .products-table th,
    .products-table td {
        padding: 12px 8px;
        font-size: 13px;
    }

    .products-table .product-thumb img {
        width: 40px;
        height: 40px;
    }

    .products-table .col-price input,
    .products-table .col-qty input {
        width: 70px;
        padding: 10px 6px;
    }

    .products-table .col-actions {
        white-space: nowrap;
    }

    .products-table .col-actions .btn-update,
    .products-table .col-actions .btn-remove {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
    }
}

/* ===========================================
   FIX 5: SIDEBAR NAVIGATION MOBILE
   =========================================== */

@media (max-width: 1024px) {
    #elettro-preventivi-wrap.with-sidebar {
        flex-direction: column;
    }

    .elettro-prev-sidebar {
        width: 100% !important;
        max-width: none !important;
        border-right: none !important;
        border-bottom: 1px solid #e0e0e0;
        position: relative !important;
    }

    .sidebar-nav {
        display: flex !important;
        flex-wrap: wrap !important;
        padding: 10px !important;
        gap: 5px;
    }

    .sidebar-nav .nav-item {
        flex: 0 0 auto;
    }

    .sidebar-nav .nav-link {
        padding: 10px 14px !important;
        font-size: 13px;
        white-space: nowrap;
    }

    .sidebar-nav .nav-link .dashicons {
        margin-right: 6px;
    }

    /* Submenu inline */
    .sidebar-nav .nav-submenu {
        position: relative !important;
        display: flex !important;
        background: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        gap: 5px;
    }
}

@media (max-width: 600px) {
    .sidebar-nav .nav-link {
        padding: 12px !important;
    }

    .sidebar-nav .nav-link span:not(.dashicons) {
        display: none;
    }

    .sidebar-nav .nav-link .dashicons {
        margin-right: 0;
        font-size: 20px;
        width: 20px;
        height: 20px;
    }
}

/* ===========================================
   FIX 6: FORM INPUTS MOBILE
   =========================================== */

@media (max-width: 768px) {
    #elettro-preventivi-edit .form-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    #elettro-preventivi-edit .form-grid .full-width {
        grid-column: 1 !important;
    }

    #elettro-preventivi-edit .form-row input,
    #elettro-preventivi-edit .form-row select,
    #elettro-preventivi-edit .form-row textarea {
        font-size: 16px !important; /* Prevent zoom on iOS */
        min-height: 48px;
    }

    #elettro-preventivi-edit .form-row textarea {
        min-height: 100px;
    }

    #elettro-preventivi-edit .form-row label {
        font-size: 14px;
        margin-bottom: 8px;
    }
}

/* ===========================================
   FIX 7: ADD PRODUCT SECTION MOBILE
   =========================================== */

.add-product-section .field-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .add-product-section .field-group {
        flex-direction: column;
        align-items: stretch;
    }

    .add-product-section .field-group > * {
        width: 100% !important;
        flex: none !important;
    }

    .add-product-section .select2-container {
        width: 100% !important;
    }

    .add-product-section #elettro-prev-add-product-btn {
        width: 100%;
        padding: 16px;
        font-size: 16px;
        justify-content: center;
    }
}

/* ===========================================
   FIX 8: MODAL MIGLIORATO PER MOBILE
   =========================================== */

@media (max-width: 600px) {
    .elettro-modal {
        padding: 10px;
        align-items: flex-end; /* Modal dal basso su mobile */
    }

    .elettro-modal-content {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
        animation: modalSlideUp 0.3s ease;
    }

    @keyframes modalSlideUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .elettro-modal-content h3 {
        font-size: 16px;
        padding: 16px 20px;
    }

    .elettro-modal-body {
        padding: 20px;
    }

    .elettro-modal-body input[type="email"] {
        font-size: 16px !important;
        padding: 16px;
    }

    .elettro-modal-footer {
        flex-direction: column-reverse;
        padding: 15px 20px 20px;
    }

    .elettro-modal-footer button {
        width: 100%;
        padding: 16px;
        font-size: 16px;
    }
}

/* ===========================================
   FIX 9: EDIT HEADER RESPONSIVE
   =========================================== */

.edit-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.edit-header h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.edit-header .back-link {
    font-size: 14px;
}

@media (max-width: 600px) {
    .edit-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .edit-header h2 {
        font-size: 20px;
    }

    .edit-header h2 mark {
        font-size: 10px;
        padding: 3px 8px;
    }
}

/* ===========================================
   FIX 10: EDIT BOXES MOBILE
   =========================================== */

@media (max-width: 768px) {
    .edit-box {
        margin-bottom: 15px;
    }

    .edit-box-header {
        padding: 14px 16px;
    }

    .edit-box-header h3 {
        font-size: 14px;
    }

    .edit-box-body {
        padding: 16px;
    }

    /* Tooltip su mobile - tap invece di hover */
    .elettro-tooltip .tooltip-text {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        bottom: 20px !important;
        top: auto !important;
        transform: none !important;
        max-width: none !important;
        z-index: 99999;
        opacity: 0;
        visibility: hidden;
    }

    .elettro-tooltip:active .tooltip-text,
    .elettro-tooltip:focus .tooltip-text {
        opacity: 1;
        visibility: visible;
    }
}

/* ===========================================
   FIX 11: SAVE BUTTON STICKY SU MOBILE
   =========================================== */

@media (max-width: 768px) {
    .edit-sidebar {
        position: relative !important;
    }

    /* MODIFICATO: I pulsanti Save sono ora nella edit-main sotto Allegati */
    .edit-main .save-section {
        position: fixed;
        bottom: 0; /* Barra mobile nascosta, bottom: 0 */
        left: 0;
        right: 0;
        padding: 15px;
        background: #fff;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
        z-index: 1000;
        margin: 0;
        display: flex;
        flex-direction: row;
        gap: 8px;
    }

    .edit-main .save-section .btn-save-main {
        margin: 0;
    }

    /* Uniforma dimensioni di tutti i pulsanti */
    .edit-main .save-section button,
    .edit-main .save-section a[class*="btn-"],
    .edit-main .save-section .btn-save-main,
    .edit-main .save-section .btn-generate-pdf {
        flex: 1;
        padding: 14px 12px !important;
        font-size: 14px !important;
        line-height: 1.2 !important;
        height: auto !important;
        min-height: 46px !important;
        box-sizing: border-box !important;
    }

    /* Aggiungi padding in fondo alla pagina per pulsanti sticky */
    #elettro-preventivi-edit {
        padding-bottom: 80px; /* Solo pulsanti, barra mobile nascosta */
    }
}

/* ===========================================
   FIX 12: SELECT2 MOBILE IMPROVEMENTS
   =========================================== */

@media (max-width: 768px) {
    .select2-container {
        width: 100% !important;
    }

    .select2-container--default .select2-selection--single {
        min-height: 48px !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 46px !important;
        font-size: 16px !important;
    }

    .select2-dropdown {
        font-size: 16px !important;
    }

    .select2-results__option {
        padding: 14px 16px !important;
        min-height: 48px !important;
    }

    .select2-search--dropdown .select2-search__field {
        font-size: 16px !important;
        padding: 12px !important;
        min-height: 48px !important;
    }
}

/* ===========================================
   FIX 13: LISTA PREVENTIVI MOBILE
   =========================================== */

@media (max-width: 768px) {
    #elettro-preventivi-wrap .preventivi-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #elettro-preventivi-wrap .preventivi-table th,
    #elettro-preventivi-wrap .preventivi-table td {
        white-space: nowrap;
        padding: 12px 10px;
        font-size: 13px;
    }

    /* Nascondi colonne meno importanti su mobile */
    #elettro-preventivi-wrap .preventivi-table .col-date-created {
        display: none;
    }

    /* Touch target per link azioni nella lista */
    #elettro-preventivi-wrap .preventivi-table .order-actions a,
    #elettro-preventivi-wrap .preventivi-table td a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 8px 4px;
    }
}

@media (max-width: 480px) {
    #elettro-preventivi-wrap .preventivi-header h2 {
        font-size: 22px;
    }

    #elettro-preventivi-wrap .nuovo-preventivo-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
}

/* ===========================================
   FIX 14: ALLEGATI SECTION MOBILE
   =========================================== */

@media (max-width: 768px) {
    .attachment-item {
        flex-direction: column;
        gap: 10px;
    }

    .attachment-item input {
        width: 100% !important;
    }

    .attachment-item .btn-view,
    .attachment-item .btn-remove-attachment {
        width: 44px;
        height: 44px;
    }

    #elettro-prev-add-attachment {
        width: 100%;
        padding: 14px;
        justify-content: center;
    }
}

/* ===========================================
   FIX 15: SCROLL INDICATOR PER TABELLE
   =========================================== */

.table-scroll-wrapper {
    position: relative;
}

.table-scroll-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.9));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.table-scroll-wrapper.has-scroll::after {
    opacity: 1;
}

/* ===========================================
   FIX 16: PRINT STYLES
   =========================================== */

@media print {
    .elettro-prev-sidebar,
    .quote-actions-bar,
    .edit-main .save-section,
    .edit-sidebar .save-section,
    .elettro-modal,
    .btn-update,
    .btn-remove,
    .add-product-section {
        display: none !important;
    }

    #elettro-preventivi-wrap {
        padding: 0 !important;
    }

    .edit-grid {
        grid-template-columns: 1fr !important;
    }

    .edit-box {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ============================================
   MOBILE FIRST - REDESIGN COMPLETO
   ============================================ */

/* ===========================================
   MOBILE BASE (< 768px)
   =========================================== */
@media screen and (max-width: 767px) {

    /* Reset completo per mobile */
    #elettro-preventivi-wrap {
        padding: 0 !important;
        margin: 0 !important;
    }

    #elettro-preventivi-wrap.with-sidebar {
        display: block !important;
        flex-direction: column !important;
    }

    /* SIDEBAR - Nascosta su mobile, usa menu hamburger o tabs */
    .elettro-prev-sidebar {
        display: none !important;
    }

    /* MAIN CONTENT - Full width */
    .elettro-prev-main-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #elettro-preventivi-edit {
        padding: 15px !important;
    }

    /* HEADER */
    .edit-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
        margin-bottom: 15px !important;
        padding-bottom: 15px !important;
        border-bottom: 1px solid #eee;
    }

    .edit-header h2 {
        font-size: 18px !important;
        margin: 0 !important;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .edit-header h2 mark {
        font-size: 10px !important;
        padding: 4px 8px !important;
    }

    .edit-header .back-link {
        font-size: 13px !important;
        color: #0073aa;
    }

    /* ACTION BUTTONS - Grid 2x3 */
    .quote-actions-bar {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 12px !important;
        margin-bottom: 15px !important;
        background: #f5f5f5 !important;
        border-radius: 8px !important;
    }

    .quote-actions-bar .action-btn {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 12px 8px !important;
        font-size: 11px !important;
        text-align: center !important;
        min-height: 60px !important;
        background: #fff !important;
        border-radius: 6px !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
        text-decoration: none !important;
        color: #333 !important;
        gap: 4px !important;
    }

    .quote-actions-bar .action-btn .dashicons {
        font-size: 20px !important;
        width: 20px !important;
        height: 20px !important;
        margin: 0 !important;
    }

    .quote-actions-bar .action-btn.btn-pdf { color: #d63638 !important; }
    .quote-actions-bar .action-btn.btn-download { color: #2271b1 !important; }
    .quote-actions-bar .action-btn.btn-email { color: #0a7e50 !important; }
    .quote-actions-bar .action-btn.btn-convert { color: #dba617 !important; }
    .quote-actions-bar .action-btn.btn-print { color: #666 !important; }

    /* EDIT GRID - Single column */
    .edit-grid {
        display: block !important;
        grid-template-columns: 1fr !important;
    }

    .edit-main,
    .edit-sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* EDIT BOXES */
    .edit-box {
        margin-bottom: 12px !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
    }

    .edit-box-header {
        padding: 12px 15px !important;
        background: #f8f9fa !important;
    }

    .edit-box-header h3 {
        font-size: 14px !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .edit-box-body {
        padding: 15px !important;
    }

    /* FORM ELEMENTS */
    .form-row {
        margin-bottom: 12px !important;
    }

    .form-row:last-child {
        margin-bottom: 0 !important;
    }

    .form-row label {
        display: block !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        margin-bottom: 6px !important;
        color: #333 !important;
    }

    .form-row input[type="text"],
    .form-row input[type="email"],
    .form-row input[type="tel"],
    .form-row input[type="number"],
    .form-row select,
    .form-row textarea {
        width: 100% !important;
        padding: 14px 12px !important;
        font-size: 16px !important;
        border: 1px solid #ddd !important;
        border-radius: 6px !important;
        background: #fff !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }

    .form-row textarea {
        min-height: 80px !important;
        resize: vertical !important;
    }

    .form-row select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: right 12px center !important;
        padding-right: 36px !important;
    }

    .form-row .field-help,
    .form-row .field-hint,
    .form-row small {
        display: block !important;
        font-size: 11px !important;
        color: #666 !important;
        margin-top: 4px !important;
    }

    .form-grid {
        display: block !important;
        grid-template-columns: 1fr !important;
    }

    .form-grid .form-row {
        margin-bottom: 12px !important;
    }

    /* TOOLTIP - Nascosto su mobile, troppo invasivo */
    .elettro-tooltip .tooltip-icon {
        display: none !important;
    }

    /* ADD PRODUCT SECTION */
    .add-product-section {
        padding: 12px !important;
        background: #f9f9f9 !important;
        border-radius: 6px !important;
        margin-bottom: 15px !important;
    }

    .add-product-section .field-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .add-product-section .field-group > * {
        width: 100% !important;
        flex: none !important;
    }

    .add-product-section label {
        font-size: 12px !important;
        font-weight: 600 !important;
        margin-bottom: 4px !important;
        display: block !important;
    }

    /* Select2 su mobile */
    .select2-container {
        width: 100% !important;
    }

    .select2-container--default .select2-selection--single {
        height: 48px !important;
        border: 1px solid #ddd !important;
        border-radius: 6px !important;
        padding: 0 12px !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 46px !important;
        font-size: 16px !important;
        padding-left: 0 !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 46px !important;
        right: 8px !important;
    }

    .select2-dropdown {
        border-radius: 6px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    }

    .select2-results__option {
        padding: 12px 14px !important;
        font-size: 15px !important;
    }

    .select2-search--dropdown .select2-search__field {
        padding: 12px !important;
        font-size: 16px !important;
    }

    #elettro-prev-add-product-btn {
        width: 100% !important;
        padding: 14px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        border-radius: 6px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
    }

    /* PRODUCTS TABLE - Card layout su mobile */
    .products-table-wrapper,
    .edit-box-body > .products-table {
        overflow-x: visible !important;
    }

    .products-table {
        display: block !important;
        width: 100% !important;
    }

    .products-table thead {
        display: none !important;
    }

    .products-table tbody {
        display: block !important;
    }

    .products-table tr.product-row {
        display: block !important;
        background: #fff !important;
        border: 1px solid #eee !important;
        border-radius: 8px !important;
        padding: 12px !important;
        margin-bottom: 10px !important;
        position: relative !important;
    }

    .products-table td {
        display: block !important;
        padding: 4px 0 !important;
        border: none !important;
        text-align: left !important;
    }

    .products-table .product-thumb {
        float: left !important;
        margin-right: 12px !important;
        margin-bottom: 8px !important;
    }

    .products-table .product-thumb img {
        width: 50px !important;
        height: 50px !important;
        border-radius: 4px !important;
        object-fit: cover !important;
    }

    .products-table .col-name {
        font-weight: 600 !important;
        font-size: 14px !important;
        padding-top: 0 !important;
        min-height: 50px !important;
    }

    .products-table .col-sku {
        display: none !important;
    }

    .products-table .col-price,
    .products-table .col-qty {
        display: inline-block !important;
        width: 48% !important;
        clear: both !important;
    }

    .products-table .col-price::before {
        content: "Prezzo: " !important;
        font-size: 11px !important;
        color: #666 !important;
        display: block !important;
        margin-bottom: 4px !important;
    }

    .products-table .col-qty::before {
        content: "Quantità: " !important;
        font-size: 11px !important;
        color: #666 !important;
        display: block !important;
        margin-bottom: 4px !important;
    }

    .products-table .col-price input,
    .products-table .col-qty input {
        width: 100% !important;
        padding: 10px !important;
        font-size: 15px !important;
        text-align: center !important;
    }

    .products-table .col-total {
        clear: both !important;
        font-weight: 700 !important;
        font-size: 16px !important;
        color: #0a7e50 !important;
        padding-top: 8px !important;
        margin-top: 8px !important;
        border-top: 1px solid #eee !important;
    }

    .products-table .col-total::before {
        content: "Totale: " !important;
        font-weight: 400 !important;
        color: #666 !important;
    }

    .products-table .col-actions {
        position: absolute !important;
        top: 10px !important;
        right: 10px !important;
        display: flex !important;
        gap: 6px !important;
    }

    .products-table .btn-update,
    .products-table .btn-remove {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
    }

    /* TFOOT - Riepilogo totali su mobile (3 righe: Imponibile, IVA, Totale) */
    .products-table tfoot {
        display: block !important;
        margin-top: 12px !important;
    }

    .products-table tfoot tr {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 15px !important;
        border: none !important;
        background: #f8f9fa !important;
        border-radius: 0 !important;
    }

    .products-table tfoot tr:first-child {
        border-radius: 8px 8px 0 0 !important;
        border-bottom: 1px solid #e0e0e0 !important;
    }

    .products-table tfoot tr:nth-child(2) {
        border-bottom: 1px solid #e0e0e0 !important;
    }

    .products-table tfoot tr.quote-total-row {
        background: #0a7e50 !important;
        color: #fff !important;
        border-radius: 0 0 8px 8px !important;
        padding: 14px 15px !important;
    }

    .products-table tfoot td {
        display: none !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
    }

    /* Mostra solo la cella etichetta (colspan=5) e la cella valore */
    .products-table tfoot td:first-child {
        display: block !important;
        font-size: 14px !important;
        color: #333 !important;
    }

    .products-table tfoot td:nth-child(2) {
        display: block !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #333 !important;
        text-align: right !important;
    }

    /* Stili specifici per la riga Totale */
    .products-table tfoot tr.quote-total-row td:first-child,
    .products-table tfoot tr.quote-total-row td:nth-child(2) {
        color: #fff !important;
        font-size: 16px !important;
        font-weight: 700 !important;
    }

    /* SIDEBAR (quando visibile su mobile) */
    .edit-sidebar {
        order: 2 !important;
        margin-top: 15px !important;
    }

    .edit-sidebar .edit-box {
        margin-bottom: 12px !important;
    }

    /* SAVE BUTTON - Sticky bottom (ora in edit-main) */
    .edit-main .save-section {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 12px 15px !important;
        background: #fff !important;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
        z-index: 9999 !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .edit-main .save-section .btn-save-main {
        width: 100% !important;
        padding: 16px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
    }

    /* Spazio per il bottone sticky */
    #elettro-prev-edit-form {
        padding-bottom: 80px !important;
    }

    /* MODAL */
    .elettro-modal {
        padding: 0 !important;
        align-items: flex-end !important;
    }

    .elettro-modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 85vh !important;
        border-radius: 16px 16px 0 0 !important;
        animation: slideUp 0.3s ease !important;
    }

    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .elettro-modal-content h3 {
        padding: 16px 20px !important;
        font-size: 16px !important;
        border-bottom: 1px solid #eee !important;
    }

    .elettro-modal-close {
        top: 12px !important;
        right: 16px !important;
        font-size: 24px !important;
        width: 32px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .elettro-modal-body {
        padding: 20px !important;
        max-height: 50vh !important;
        overflow-y: auto !important;
    }

    .elettro-modal-body input {
        font-size: 16px !important;
        padding: 14px !important;
    }

    .elettro-modal-footer {
        padding: 15px 20px 25px !important;
        flex-direction: column-reverse !important;
        gap: 10px !important;
    }

    .elettro-modal-footer button {
        width: 100% !important;
        padding: 14px !important;
        font-size: 15px !important;
        border-radius: 8px !important;
    }

    /* ALLEGATI */
    .attachment-item {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 10px !important;
        background: #f9f9f9 !important;
        border-radius: 6px !important;
        margin-bottom: 8px !important;
    }

    .attachment-item input {
        flex: 1 !important;
        min-width: 0 !important;
        font-size: 13px !important;
        padding: 10px !important;
    }

    .attachment-item .btn-view,
    .attachment-item .btn-remove-attachment {
        width: 40px !important;
        height: 40px !important;
        flex-shrink: 0 !important;
    }

    #elettro-prev-add-attachment {
        width: 100% !important;
        padding: 12px !important;
        margin-top: 10px !important;
    }

    /* BADGE MIO */
    .badge-mio {
        font-size: 9px !important;
        padding: 2px 6px !important;
    }

    /* STATUS SELECT nella sidebar */
    .edit-sidebar select {
        width: 100% !important;
        padding: 14px 12px !important;
        font-size: 16px !important;
    }

    /* TOAST su mobile */
    .elettro-toast {
        left: 15px !important;
        right: 15px !important;
        top: auto !important;
        bottom: 90px !important;
        text-align: center !important;
    }
}

/* ===========================================
   TABLET (768px - 1024px)
   =========================================== */
@media screen and (min-width: 768px) and (max-width: 1024px) {

    #elettro-preventivi-wrap.with-sidebar {
        flex-direction: column !important;
    }

    .elettro-prev-sidebar {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #e0e0e0 !important;
        padding: 15px !important;
    }

    .sidebar-nav {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: center !important;
    }

    .sidebar-nav .nav-item {
        flex: 0 0 auto !important;
    }

    .sidebar-nav .nav-link {
        padding: 10px 16px !important;
        font-size: 13px !important;
        border-radius: 20px !important;
        background: #f5f5f5 !important;
    }

    .sidebar-nav .nav-link.active {
        background: #0a7e50 !important;
        color: #fff !important;
    }

    .elettro-prev-main-content {
        width: 100% !important;
        padding: 20px !important;
    }

    /* Action buttons in row */
    .quote-actions-bar {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .quote-actions-bar .action-btn {
        flex: 1 1 auto !important;
        min-width: 120px !important;
    }

    /* Form grid 2 columns */
    .form-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    .form-grid .full-width {
        grid-column: span 2 !important;
    }

    /* Products table - normal but scrollable */
    .products-table {
        display: table !important;
    }

    .products-table thead {
        display: table-header-group !important;
    }

    .products-table tbody {
        display: table-row-group !important;
    }

    .products-table tr {
        display: table-row !important;
    }

    .products-table td,
    .products-table th {
        display: table-cell !important;
    }

    /* Edit grid side by side */
    .edit-grid {
        display: grid !important;
        grid-template-columns: 1fr 300px !important;
        gap: 20px !important;
    }

    .edit-sidebar {
        position: sticky !important;
        top: 20px !important;
        align-self: start !important;
    }
}

/* ===========================================
   SMALL MOBILE (< 380px)
   =========================================== */
@media screen and (max-width: 379px) {

    #elettro-preventivi-edit {
        padding: 10px !important;
    }

    .edit-header h2 {
        font-size: 16px !important;
    }

    .quote-actions-bar {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        padding: 10px !important;
    }

    .quote-actions-bar .action-btn {
        padding: 10px 6px !important;
        font-size: 10px !important;
        min-height: 55px !important;
    }

    .quote-actions-bar .action-btn .dashicons {
        font-size: 18px !important;
        width: 18px !important;
        height: 18px !important;
    }

    .edit-box-header {
        padding: 10px 12px !important;
    }

    .edit-box-header h3 {
        font-size: 13px !important;
    }

    .edit-box-body {
        padding: 12px !important;
    }

    .form-row input,
    .form-row select,
    .form-row textarea {
        padding: 12px 10px !important;
        font-size: 15px !important;
    }
}

/* ===========================================
   MOBILE QUICK NAVIGATION
   =========================================== */

.mobile-quick-nav {
    display: none;
}

@media screen and (max-width: 767px) {
    .mobile-quick-nav {
        display: flex !important;
        position: sticky;
        top: 0;
        z-index: 1000;
        background: #fff;
        border-bottom: 1px solid #eee;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .mobile-quick-nav .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 10px 5px;
        text-decoration: none;
        color: #666;
        font-size: 11px;
        font-weight: 500;
        transition: all 0.2s;
        border-bottom: 2px solid transparent;
    }

    .mobile-quick-nav .mobile-nav-item:active,
    .mobile-quick-nav .mobile-nav-item.active {
        color: #0a7e50;
        background: #f0faf6;
        border-bottom-color: #0a7e50;
    }

    .mobile-quick-nav .mobile-nav-item .dashicons {
        font-size: 20px;
        width: 20px;
        height: 20px;
        margin-bottom: 2px;
    }

    .mobile-quick-nav .mobile-nav-item span:last-child {
        font-size: 10px;
    }
}

/* ===========================================
   ADDITIONAL MOBILE IMPROVEMENTS
   =========================================== */

@media screen and (max-width: 767px) {

    /* Fix per elementi che potrebbero essere troppo larghi */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Nascondi elementi non essenziali su mobile */
    .edit-box-header .elettro-tooltip,
    .form-row .elettro-tooltip {
        display: none !important;
    }

    /* Assicura che le immagini non escano */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Fix scroll orizzontale */
    body {
        overflow-x: hidden;
    }

    html {
        overflow-x: hidden;
    }

    /* Migliora touch sui link */
    a, button, .action-btn, .btn, input[type="submit"] {
        touch-action: manipulation;
    }

    /* Focus states più evidenti per accessibilità */
    input:focus,
    select:focus,
    textarea:focus,
    button:focus {
        outline: 2px solid #0a7e50 !important;
        outline-offset: 2px !important;
    }

    /* Placeholder più leggibili */
    ::placeholder {
        color: #999 !important;
        opacity: 1 !important;
    }

    /* Disabilita zoom su doppio tap */
    input, select, textarea {
        touch-action: manipulation;
    }

    /* Fix per il keyboard che spinge il contenuto */
    .elettro-modal-content {
        max-height: calc(100vh - 50px) !important;
    }

    /* Migliora scroll momentum su iOS */
    .edit-box-body,
    .elettro-modal-body,
    .products-table-wrapper {
        -webkit-overflow-scrolling: touch;
    }

    /* Nascondi scrollbar ma mantieni funzionalità */
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

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

    ::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 2px;
    }

    /* Badge status più compatto */
    .edit-header h2 mark {
        white-space: nowrap;
    }

    /* Pulsante salva - assicura visibilità */
    .btn-save-main {
        position: relative;
        z-index: 100;
    }

    /* Loading overlay più evidente */
    .elettro-loading::after {
        background: rgba(255,255,255,0.9);
    }
}

/* ===========================================
   LANDSCAPE MOBILE
   =========================================== */

@media screen and (max-width: 767px) and (orientation: landscape) {
    .mobile-quick-nav {
        padding: 5px 0;
    }

    .mobile-quick-nav .mobile-nav-item {
        padding: 6px 5px;
    }

    .mobile-quick-nav .mobile-nav-item .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }

    .edit-main .save-section {
        padding: 8px 15px !important;
    }

    .edit-main .save-section .btn-save-main {
        padding: 12px !important;
        font-size: 14px !important;
    }

    #elettro-prev-edit-form {
        padding-bottom: 60px !important;
    }

    .quote-actions-bar .action-btn {
        min-height: 50px !important;
    }
}

/* ===========================================
   HIGH DPI / RETINA DISPLAYS
   =========================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .products-table .product-thumb img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ===========================================
   MODIFICHE TICKET #70901
   =========================================== */

/* Pulsante "Genera PDF e Scarica" accanto a Salva */
#elettro-preventivi-edit .save-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#elettro-preventivi-edit .save-section .btn-generate-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff !important;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

#elettro-preventivi-edit .save-section .btn-generate-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 113, 177, 0.4);
    background: linear-gradient(135deg, #135e96 0%, #0a4a7a 100%);
}

#elettro-preventivi-edit .save-section .btn-generate-pdf .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Fix simbolo € in Select2 - garantire encoding UTF-8 corretto */
.select2-container--default .select2-results__option,
.select2-container--default .select2-selection--single .select2-selection__rendered {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Scrolling migliorato per tabella prodotti */
#elettro-preventivi-edit .products-table-wrapper {
    overflow-y: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

#elettro-preventivi-edit .products-table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#elettro-preventivi-edit .products-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#elettro-preventivi-edit .products-table-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#elettro-preventivi-edit .products-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Nascondi barra mobile del tema quando si apre un preventivo */
body:has(#elettro-preventivi-edit) .et-mobile-panel-wrapper {
    display: none !important;
}

/* Mobile responsive per nuovi pulsanti - SPOSTATI SOTTO ALLEGATI */
@media screen and (max-width: 782px) {
    #elettro-preventivi-edit .edit-main .save-section {
        position: fixed;
        bottom: 0; /* Barra mobile nascosta, torniamo a bottom: 0 */
        left: 0;
        right: 0;
        z-index: 999;
        background: #fff;
        padding: 12px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        flex-direction: row;
        gap: 8px;
        margin: 0;
    }

    #elettro-preventivi-edit .edit-main .save-section .btn-save-main,
    #elettro-preventivi-edit .edit-main .save-section .btn-generate-pdf,
    #elettro-preventivi-edit .edit-main .save-section button,
    #elettro-preventivi-edit .edit-main .save-section a[class*="btn-"] {
        flex: 1;
        padding: 14px 12px !important;
        font-size: 14px !important;
        line-height: 1.2 !important;
        height: auto !important;
        min-height: 46px !important;
        box-sizing: border-box !important;
    }
}

/* ==========================================
   SEZIONE DATI AZIENDA (Intestazione PDF)
   ========================================== */

/* Stile base della sezione */
.company-data-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border: 2px solid #4a90e2 !important;
    border-radius: 10px !important;
    padding: 24px !important;
    margin-bottom: 24px !important;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1) !important;
}

.company-data-section .edit-box-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    color: #2c3e50 !important;
    font-size: 18px !important;
}

.company-data-section .edit-box-header h3 .dashicons {
    color: #4a90e2;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.company-data-section .edit-box-body .description {
    margin-bottom: 20px !important;
    color: #495057 !important;
    font-size: 14px !important;
    font-style: italic;
    background: #fff;
    padding: 12px 16px;
    border-left: 4px solid #4a90e2;
    border-radius: 4px;
}

/* Form row groups - Grid layout */
.form-row-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.company-data-section .form-row {
    margin-bottom: 0 !important;
}

.form-row-small {
    min-width: 150px !important;
}

/* Labels migliorati */
.company-data-section label {
    display: block;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin-bottom: 8px !important;
    font-size: 13px !important;
}

/* Input fields migliorati */
.company-data-section input[type="text"],
.company-data-section input[type="email"],
.company-data-section input[type="tel"],
.company-data-section input[type="url"] {
    width: 100% !important;
    padding: 10px 14px !important;
    border: 1px solid #ced4da !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
    background: #fff !important;
}

.company-data-section input:focus {
    border-color: #4a90e2 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1) !important;
}

.company-data-section input::placeholder {
    color: #adb5bd !important;
    font-style: italic;
}

/* Field help text */
.company-data-section .field-help {
    display: block;
    margin-top: 20px;
    padding: 12px 16px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    color: #856404 !important;
    font-size: 13px !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .form-row-group {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .company-data-section {
        padding: 16px !important;
    }

    .company-data-section .edit-box-header h3 {
        font-size: 16px !important;
    }

    .company-data-section input[type="text"],
    .company-data-section input[type="email"],
    .company-data-section input[type="tel"],
    .company-data-section input[type="url"] {
        padding: 12px !important;
        font-size: 16px !important; /* Previene zoom su iOS */
    }
}

/* Animazione on focus */
.company-data-section input[type="text"]:focus,
.company-data-section input[type="email"]:focus,
.company-data-section input[type="tel"]:focus,
.company-data-section input[type="url"]:focus {
    transform: translateY(-1px);
}

/* Required field indicator */
.company-data-section label:has(+ input[required])::after,
.company-data-section label[for="company-name"]::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* ==========================================
   COLONNA INTESTAZIONE LISTA PREVENTIVI
   ========================================== */

/* Colonna intestazione nella tabella preventivi */
.preventivi-table .order_header {
    width: 200px;
    max-width: 200px;
    font-size: 13px;
    line-height: 1.4;
    vertical-align: middle;
}

.preventivi-table .order_header strong {
    display: block;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 3px;
    font-size: 13px;
}

.preventivi-table .order_header small {
    display: block;
    color: #6c757d;
    font-size: 11px;
    font-weight: normal;
}

.preventivi-table .order_header em {
    color: #adb5bd !important;
    font-size: 12px;
}

/* Mobile responsive per colonna intestazione */
@media (max-width: 768px) {
    .preventivi-table .order_header {
        width: auto;
        min-width: 140px;
        max-width: none;
    }

    .preventivi-table .order_header strong {
        font-size: 12px;
    }

    .preventivi-table .order_header small {
        font-size: 10px;
    }
}

/* ==========================================
   COLONNA RIFERIMENTO LISTA PREVENTIVI
   ========================================== */

/* Colonna riferimento nella tabella preventivi */
.preventivi-table .order_reference {
    width: 20%;
    text-align: left;
    font-size: 13px;
    line-height: 1.4;
    vertical-align: middle;
}

.preventivi-table .order_reference em {
    font-style: italic;
    color: #999;
    font-size: 12px;
}

/* Mobile responsive per colonna riferimento */
@media (max-width: 768px) {
    .preventivi-table .order_reference {
        width: auto;
        min-width: 120px;
    }

    .preventivi-table .order_reference em {
        font-size: 11px;
    }
}

/* ============================================
   JQUERY UI AUTOCOMPLETE - Ricerca Prodotti
   ============================================ */

.elettro-autocomplete-input {
    width: 100% !important;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

.elettro-autocomplete-input:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Dropdown autocomplete */
.ui-autocomplete {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999999 !important;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ui-autocomplete .ui-menu-item {
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #f0f0f0;
}

.ui-autocomplete .ui-menu-item:last-child {
    border-bottom: none;
}

.ui-autocomplete .ui-menu-item-wrapper {
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    color: #333;
}

.ui-autocomplete .ui-menu-item-wrapper:hover,
.ui-autocomplete .ui-state-active {
    background-color: #f0f6fc !important;
    border-color: transparent !important;
    color: #2271b1 !important;
}

/* Loading state */
.elettro-autocomplete-input.ui-autocomplete-loading {
    background-image: url('data:image/gif;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA==');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}

/* Messaggio "Nessun risultato" */
.ui-autocomplete .ui-menu-item.no-results {
    padding: 10px 12px;
    color: #666;
    font-style: italic;
}
