/* ============================================================
   ENTITY FORM STYLING
   ============================================================ */

/* ===== REMOVE ALL LINES ===== */
.entity-form table tbody tr, 
.entity-form td {
    border-bottom: none !important;
}

/* ===== SPACING ===== */
.entity-form td {
    margin-bottom: 18px !important;
    padding-bottom: 0 !important;
}

/* ===== CENTER FORM ===== */
.entity-form {
    max-width: 1000px !important; /* Increased from 900 */
    margin: 60px auto !important;
}

/* ===== LABEL ===== */
.entity-form .info label {
    display: block !important;
    font-weight: 700 !important;
    color: #000 !important;
    margin-bottom: 8px !important;
}

/* ===== RADIO BUTTONS ===== */
.entity-form .boolean-radio {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
}

.entity-form .boolean-radio label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
}

.entity-form .boolean-radio input[type="radio"] {
    margin-right: 4px !important;
}

/* ===== INPUT / TEXTAREA ===== */
.entity-form input:not([type="radio"]):not([type="checkbox"]), 
.entity-form textarea {
    width: 100% !important;
    padding: 12px !important;
    height: 45px !important;
    border-radius: 4px !important;
    border: 1px solid #ccc !important;
    font-size: 14px !important;
}

/* Textarea exception */
.entity-form textarea {
    height: auto !important;
    min-height: 80px !important;
}

/* ===== SELECT FIX ===== */
.entity-form select {
    width: 100% !important;
    height: 48px !important;
    padding: 0 12px !important;
    border-radius: 4px !important;
    border: 1px solid #ccc !important;
    font-size: 14px !important;
}

/* ===== SUBMIT BUTTON (REAL FIX) ===== */
.actions {
    display: flex !important;
    justify-content: flex-end !important;
    max-width: 1000px !important;
    margin: 30px auto 0 auto !important;
}

/* Override MS default left alignment */
.form-action-container-left {
    float: none !important;
    text-align: right !important;
}

/* Button styling */
.actions input[type="button"], 
.actions input[type="submit"] {
    padding: 12px 25px !important;
    background: #0078d4 !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    transition: background 0.2s ease;
}

.actions input[type="button"]:hover, 
.actions input[type="submit"]:hover {
    background: #005a9e !important;
    cursor: pointer;
}

/* ===== LOOKUP / SEARCH ICON FIX (STRICT) ===== */

/* 1. Target the lookup input only */
.entity-form .input-group input.lookup {
    height: 45px !important;
    border-top-right-radius: 4px !important; /* Default back to rounded */
    border-bottom-right-radius: 4px !important;
    border-right: 1px solid #ccc !important;
}

/* 2. Style ONLY the Search Button, NOT the Calendar */
.entity-form .input-group-btn > button.launchentitylookup {
    height: 45px !important;
    width: 45px !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: #fff !important;
    border: 1px solid #ccc !important;
    /* This merges it with the bar */
    border-left: none !important; 
    border-top-right-radius: 4px !important;
    border-bottom-right-radius: 4px !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: top !important;
}

/* 3. Ensure the lookup input loses its right-side roundness ONLY when the button is there */
.entity-form .input-group:has(button.launchentitylookup) input.lookup {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* 4. RESET for Calendar Button (Ensures it stays untouched) */
.entity-form .input-group-btn > button:not(.launchentitylookup) {
    background-color: #eee !important; /* Standard gray background for calendar */
    border: 1px solid #ccc !important;
    height: 45px !important;
    width: auto !important;
}


/* ============================================================
   MODERNIZED LIST VIEW (WIDE VERSION)
   ============================================================ */

/* 1. Main Table Container - Updated to 1400px for extra width */
.entitylist {
    max-width: 1400px !important; 
    width: 95% !important; /* Ensures it stays fluid on smaller screens */
    margin: 40px auto !important;
    background: #ffffff !important;
    padding: 24px !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05) !important;
}

/* 2. Create Button Styling */
.entitylist .view-toolbar {
    margin-bottom: 30px !important;
    display: flex !important;
    justify-content: flex-end !important; /* Aligns Create button to the far right of the wide view */
}

.entitylist .view-toolbar a.create-action {
    background: #0078d4 !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.25) !important;
}

/* 3. Modern Headers */
.entitylist thead th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    padding: 16px !important;
    border: none !important;
}

/* 4. Cleaner Rows */
.entitylist tbody tr {
    transition: all 0.2s ease !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.entitylist tbody tr:hover {
    background-color: #f8fafc !important;
}

.entitylist tbody td {
    padding: 20px 16px !important;
    font-size: 14px !important;
    color: #1e293b !important;
    vertical-align: middle !important;
}

/* 5. Highlight Case Numbers */
.entitylist tbody td:first-child {
    font-weight: 700 !important;
    color: #0078d4 !important;
}

/* 6. Action Dropdown Styling */
.entitylist .dropdown-toggle {
    border: 1px solid #e2e8f0 !important;
    background: #fff !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    color: #64748b !important;
}

/* 7. Pagination Container & Buttons - Updated for Width */
.entitylist .view-pagination {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important; /* Centers pagination within the new wide width */
    margin-top: 30px !important;
}

.entitylist .pagination {
    display: flex !important;
    padding-left: 0 !important;
    list-style: none !important;
    border-radius: 4px !important;
}

.entitylist .pagination li a {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    color: #64748b !important;
    font-weight: 600 !important;
    padding: 10px 16px !important;
    margin: 0 3px !important;
    background: #fff !important;
}

.entitylist .pagination .active a {
    background-color: #0078d4 !important;
    color: white !important;
    border-color: #0078d4 !important;
}

/* Ensure the wrapper doesn't restrict the list */
.view-grid {
    width: 100% !important;
}