.clg-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
}

.clg-form-section, .clg-preview-section {
    flex: 1;
    min-width: 300px;
    padding: 32px;
    box-sizing: border-box;
    background: #fff;
    border-radius: 20px; /* Premium Card Radius */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #e5e7eb; /* Visible border */
}

.clg-form-section {
    border-right: none;
}

/* Override theme styles for the wrapper class to prevent shrinking */
.clg-container .clg-form-section.pt-order-review-wrapper {
    width: 100% !important;
    float: none !important;
    flex: 1;
    max-width: none !important;
}

.clg-preview-section {
    position: relative;
}

/* Download PDF Button */
.clg-download-btn {
    position: absolute;
    top: 90px;
    right: 32px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    color: #374151;
    padding: 10px;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.clg-download-btn:hover {
    background-color: #f9fafb;
    color: #4f46e5;
    border-color: #4f46e5;
    transform: translateY(-2px);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e1; /* Darker border (Slate-300) */
    border-radius: 12px;
    font-size: 15px;
    box-sizing: border-box;
    background-color: #f9fafb;
    transition: all 0.2s;
    color: #1f2937;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #4f46e5;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

h2, h3 {
    color: #111827;
    margin-top: 0;
    font-weight: 700;
}

h2 { margin-bottom: 24px; font-size: 24px; }
h3 { margin-bottom: 16px; font-size: 18px; }

/* Custom Search Styles */
.clg-search-container {
    position: relative;
    margin-bottom: 32px;
}

.clg-search-wrapper {
    display: flex;
    gap: 12px;
}

.clg-search-wrapper input {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    background-color: #f9fafb;
    transition: all 0.2s;
}

.clg-search-wrapper input:focus {
    border-color: #4f46e5;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.clg-search-wrapper button {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    border: none;
    padding: 0 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(234, 88, 12, 0.3);
}

.clg-search-wrapper button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(234, 88, 12, 0.4);
    background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
}

.clg-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    padding: 8px 0;
}

.clg-search-results.active {
    display: block;
}

.clg-search-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 15px;
    color: #374151;
}

.clg-search-item:last-child {
    border-bottom: none;
}

.clg-search-item:hover {
    background-color: #f9fafb;
    color: #4f46e5;
}

/* Preview Styles */
.clg-letter-header {
    background: linear-gradient(135deg, #4285f4 0%, #3b82f6 100%);
    color: white;
    padding: 24px 32px;
    margin: -32px -32px 32px -32px;
    border-radius: 20px 20px 0 0;
}

.clg-letter-header h2 {
    color: white;
    margin: 0;
    font-size: 18px;
}

.clg-letter-content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.clg-recipient-address {
    margin-bottom: 20px;
    white-space: pre-line;
}

.clg-date {
    margin-bottom: 20px;
}

.clg-subject {
    margin-bottom: 20px;
}

.clg-salutation {
    margin-bottom: 15px;
}

.clg-body p {
    margin-bottom: 15px;
}

.clg-summary {
    background: #f9f9f9;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.summary-row {
    margin-bottom: 5px;
}

.clg-signature {
    margin-top: 30px;
    font-family: 'Brush Script MT', cursive;
    font-size: 24px;
    color: #4285f4;
}

.terms-checkbox {
    margin: 20px 0;
    font-size: 14px;
}

.terms-checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: normal;
}

.terms-checkbox a {
    color: #4285f4;
    text-decoration: none;
}

/* WooCommerce Checkout Integration Styles */
.clg-checkout-section {
    margin-top: 40px;
    background: #fff;
    padding: 32px;
    border-radius: 20px; /* Premium Card Radius */
    clear: both;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #e5e7eb;
}

.clg-checkout-section h3 {
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 700;
}

/* Hide fields we sync (Billing) */
.clg-checkout-section .woocommerce-billing-fields {
    display: none;
}

/* Hide Additional Fields (Order Notes) */
.clg-checkout-section .woocommerce-additional-fields {
    display: none;
}

/* Hide Coupon */
.clg-checkout-section .woocommerce-form-coupon-toggle,
.clg-checkout-section .woocommerce-form-coupon {
    display: none !important;
}

/* Style Order Review / Payment Section */
#order_review_heading {
    display: none;
}

#order_review {
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
    width: 100% !important;
    box-sizing: border-box;
}

/* Table styling for "Je Bestelling" */
#order_review table.shop_table {
    border: none;
    width: 100% !important;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 24px;
}

#order_review table.shop_table th,
#order_review table.shop_table td {
    border-bottom: 1px solid #f3f4f6;
    padding: 16px 0;
    color: #374151;
    font-size: 15px;
}

#order_review table.shop_table th {
    font-weight: 600;
}

/* Payment Methods Styling */
#payment {
    background: transparent !important;
}

#payment ul.payment_methods {
    border-bottom: none !important;
    padding: 0 !important;
}

#payment div.place-order {
    padding: 20px 0 0 0 !important;
    background: transparent !important;
}

/* Place Order Button */
#place_order {
    width: 100% !important;
    background-color: #6200ea !important; /* Purple from Photo 2 */
    color: white !important;
    padding: 15px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    border-radius: 50px !important;
    transition: background 0.2s;
    white-space: normal !important;
    display: block !important;
}

#place_order:hover {
    background-color: #4a00b0 !important;
}

@media (max-width: 768px) {
    .clg-container {
        flex-direction: column;
    }
    .clg-form-section {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
}

/* Category Browser Styles */
.clg-browser-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 40px 0;
}

.clg-view h3 {
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    border-bottom: none;
    padding-bottom: 0;
    display: block;
}

/* Category Grid */
.clg-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px; /* Increased gap */
}

.clg-category-btn {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 20px; /* Squircle */
    padding: 24px;
    text-align: center;
    cursor: pointer;
    font-size: 25px;
    font-weight: 600;
    color: #374151;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    min-height: 140px; /* Uniform Height */
    display: flex;
    align-items: center;
    justify-content: center;
}

.clg-category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: background 0.3s;
}

.clg-category-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    color: #4f46e5;
    background: #fff;
    border-color: rgba(79, 70, 229, 0.1);
}

.clg-category-btn:hover::before {
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
}

/* Company List */
.clg-company-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px; /* Increased gap */
}

.clg-company-item {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 20px; /* Squircle */
    text-align: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 140px; /* Uniform Height */
}

.clg-company-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: background 0.3s;
    z-index: 1;
}

.clg-company-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    color: #4f46e5;
    background: #fff;
    border-color: rgba(79, 70, 229, 0.1);
}

.clg-company-item:hover::before {
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
}

.clg-company-item a {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 36px;
    text-decoration: none;
    color: inherit;
    font-weight: inherit;
    font-size: 25px;
    text-align: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    z-index: 2;
}

/* Back Button */
#clg-back-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#clg-back-btn:hover {
    color: #111827;
    background: transparent;
    border: none;
}

/* Mobile Adjustments for Categories */
@media (max-width: 600px) {
    .clg-category-grid {
        grid-template-columns: 1fr; /* Full width cards on mobile */
        gap: 16px;
    }
    
    .clg-company-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .clg-category-btn {
        padding: 20px;
        font-size: 18px; /* Standard size for mobile */
    }

    .clg-company-item a {
        padding: 20px;
        font-size: 18px; /* Standard size for mobile */
    }
}

/* Hide WordPress Notices on CLG Pages */
div.notice, div.updated, div.error, .is-dismissible {
    display: none !important;
}

/* =========================================
   Mega Premium SaaS Dashboard Styles
   ========================================= */

.clg-dashboard-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #111827;
    background-color: #f9fafb; /* Light gray background */
    padding: 32px;
    border-radius: 24px;
    margin-top: 20px;
}

/* Header Section */
.clg-dashboard-header {
    background: #fff;
    padding: 32px 40px;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 40px;
    border: 1px solid rgba(0,0,0,0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clg-header-content {
    display: flex;
    align-items: center;
    gap: 24px;
}

.clg-avatar {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-radius: 20px; /* Squircle */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.clg-user-info h2 {
    font-size: 26px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 4px 0;
    letter-spacing: -0.025em;
}

.clg-user-email {
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
}

/* Metrics Grid */
.clg-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px;
    margin-bottom: 40px;
}

.clg-metric-card {
    background: #fff;
    padding: 28px;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0,0,0,0.02);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.clg-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: background 0.3s;
}

.clg-metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.clg-metric-card:hover::before {
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
}

.clg-metric-content {
    display: flex;
    flex-direction: column;
}

.clg-metric-label {
    font-size: 13px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.clg-metric-value {
    font-size: 32px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.025em;
    line-height: 1;
}

.clg-metric-sub {
    font-size: 18px;
    color: #9ca3af;
    font-weight: 500;
}

/* Icons */
.clg-metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.clg-metric-card:hover .clg-metric-icon {
    transform: scale(1.1) rotate(5deg);
}

.clg-metric-icon svg {
    width: 28px;
    height: 28px;
}

.clg-icon-blue { background: #e0e7ff; color: #4338ca; }
.clg-icon-purple { background: #ede9fe; color: #7c3aed; }
.clg-icon-green { background: #dcfce7; color: #15803d; }
.clg-icon-orange { background: #ffedd5; color: #c2410c; }

/* Content Card */
.clg-content-card {
    background: transparent; 
    border-radius: 20px;
    border: none;
    overflow: visible; 
}

/* Header for the List Section (Replacing Card Header) */
.clg-list-section-header {
    margin-bottom: 24px;
}

.clg-list-section-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #111827;
}

/* New List Layout (Flex Cards) */
.clg-list-header {
    display: flex;
    padding: 0 28px;
    margin-bottom: 16px;
}

.clg-list-header-item {
    font-size: 12px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.clg-list-card {
    background: #fff;
    padding: 24px 28px;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.clg-list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* List Columns */
.clg-col-company { flex: 2; min-width: 0; padding-right: 15px; }
.clg-col-address { flex: 2; min-width: 0; padding-right: 15px; }
.clg-col-date { flex: 1; min-width: 0; padding-right: 15px; }
.clg-col-status { flex: 0.8; min-width: 0; text-align: right; display: flex; justify-content: flex-end; }

/* Admin Columns Extensions */
.clg-col-customer { flex: 2; min-width: 0; padding-right: 15px; }
.clg-col-email { flex: 2; min-width: 0; padding-right: 15px; overflow: hidden; text-overflow: ellipsis; }
.clg-col-time { flex: 1; min-width: 0; padding-right: 15px; }
.clg-col-action { flex: 1; min-width: 0; text-align: right; display: flex; justify-content: flex-end; }
.clg-col-count { flex: 1; min-width: 0; padding-right: 15px; }
.clg-col-rank { flex: 0.5; min-width: 0; font-weight: bold; color: #9ca3af; padding-right: 15px; }
.clg-col-category { flex: 1; min-width: 0; padding-right: 15px; }
.clg-col-order { flex: 1; min-width: 0; font-weight: bold; padding-right: 15px; }
.clg-col-total { flex: 1; min-width: 0; font-weight: bold; padding-right: 15px; }

/* Company Cell Styles */
.clg-company-cell {
    display: flex;
    align-items: center;
    gap: 16px;
}

.clg-company-icon {
    width: 48px;
    height: 48px;
    background: #f3f4f6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #6b7280;
    font-size: 18px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.clg-list-card:hover .clg-company-icon {
    background: #e0e7ff;
    color: #4f46e5;
}

.clg-company-name {
    font-weight: 600;
    color: #111827;
    font-size: 15px;
}

.clg-address-text {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.4;
}

.clg-date-text {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.clg-status-badge {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 9999px;
    letter-spacing: 0.025em;
    display: inline-block;
}

.clg-status-badge.ready {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #d1fae5;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* WooCommerce Account Forms Overrides */
.woocommerce-account .woocommerce-EditAccountForm fieldset,
.woocommerce-account form.woocommerce-EditAccountForm {
    background: #fff;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0,0,0,0.02);
    margin-top: 20px;
}

.woocommerce-account form .form-row {
    margin-bottom: 24px;
}

.woocommerce-account form .form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.woocommerce-account form .form-row input.input-text,
.woocommerce-account form .form-row textarea {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background-color: #fff;
    font-size: 15px;
    color: #111827;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    box-sizing: border-box; /* Ensure padding doesn't break width */
}

.woocommerce-account form .form-row input.input-text:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
}

.woocommerce-account form fieldset {
    margin-top: 32px;
}

.woocommerce-account form legend {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 20px;
    display: block;
    width: 100%;
}

.woocommerce-account .button {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    color: white !important;
    border-radius: 99px !important;
    padding: 16px 40px !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    border: none !important;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3) !important;
    transition: transform 0.2s !important;
    margin-top: 20px;
    display: inline-block;
}

.woocommerce-account .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4) !important;
}

/* Mobile */
@media (max-width: 768px) {
    .clg-dashboard-wrapper { padding: 15px; margin-top: 0; border-radius: 0; }
    .clg-dashboard-header { flex-direction: column; text-align: center; gap: 20px; padding: 24px; }
    .clg-header-content { flex-direction: column; }
    .clg-metrics-grid { grid-template-columns: 1fr; gap: 15px; }
    .clg-metric-card { padding: 20px; }
    
    /* Update Mobile Styles for List Cards */
    .clg-list-header { display: none; }
    .clg-list-card { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
    .clg-col-company, .clg-col-address, .clg-col-date, .clg-col-status { width: 100%; padding-right: 0; }
    .clg-col-status { text-align: left; justify-content: flex-start; }

    /* Admin Columns Mobile */
    .clg-col-customer, .clg-col-email, .clg-col-time, .clg-col-action, 
    .clg-col-count, .clg-col-rank, .clg-col-category, .clg-col-order, .clg-col-total { 
        width: 100%; padding-right: 0; text-align: left; justify-content: flex-start; 
    }
    
    .woocommerce-account .woocommerce-EditAccountForm fieldset,
    .woocommerce-account form.woocommerce-EditAccountForm { padding: 20px; }
}
