/* Layout Container */
.gh-form-container {
    max-width: 100%;
    margin: 0px;
    padding: 40px;
    border: 1px solid #dddcdc;
    background: #fff;
}

/* Global Input Styles */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea {
    border: 1px solid #dddcdc !important;
    padding: 10px;
    margin-bottom: 6px;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px; /* Optimized for Mobile Safari zoom */
    font-family: inherit;
}

.ticket-sorting input[type="text"] {
    margin-bottom: 0px;
    font-size: 14px;
    padding: 3px 7px 5px 7px !important;
}

/* Focus State for Mandatory Fields */
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    border-color: #4472c4 !important;
    outline: none;
    box-shadow: 0 0 5px rgba(68, 114, 196, 0.2);
}

/* Label Spacing */
label {
    display: inline-block;
    font-weight: bold;
    margin-bottom: 0px;
    font-size: 14px;
}

.edit-page label {
    padding: 6px 0px 4px 0px;
}

/* Customer Section Grid */
.gh-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

/* Totals Area */
.gh-totals {
    text-align: right;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #333;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.gh-totals div {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 5px;
}

/* Primary Button Styling */
.submit-btn {
    display: block;
    width: 100%;
    margin-top: 30px;
    padding: 15px;
    font-weight: bold;
    cursor: pointer;
    background-color: #99cc33 !important; /* Default Green Heat Lime */
    color: white !important;
    border: none !important;
    border-radius: 5px;
    font-size: 18px;
    transition: background-color 0.3s ease;
}

/* Hover State: Blue */
.submit-btn:hover {
    background-color: #4472c4 !important; 
}

.remove-btn {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 18px;
}

/* Fix for Admin Search Alignment */
.wrap form[style*="flex"] {
    flex-wrap: wrap; 
}

.wrap form[style*="flex"] input[type="text"] {
    border: 1px solid #ccc !important;
}

/* Pagination Styling */
.tablenav-pages .page-numbers {
    background: #fff;
    border: 1px solid #ccc;
    padding: 5px 10px;
    text-decoration: none;
    margin-right: 4px;
    border-radius: 3px;
}

.tablenav-pages .page-numbers.current {
    background: #f0f0f1;
    border-color: #8c8f94;
    font-weight: bold;
}

.tablenav-pages .page-numbers:hover {
    background: #f0f0f1;
    border-color: #4472c4;
}

.widefat td {
    font-size: 14px;
    line-height: 1.1em;
    padding: 16px 2px 16px 8px;
}

td.button-pages {
    padding-top: 12px;
}

input[type="text"].search-button {
    height: 30px;
    width: 240px;
    padding: 0 5px;
}

/* MOBILE RESPONSIVENESS */
@media screen and (max-width: 782px) {
    .gh-section {
        grid-template-columns: 1fr;
    }

    /* Target the Item Rows: Remove mobile border to match desktop */
    #gh-ticket-form form > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        border: none !important; 
    }

    .gh-form-container {
        padding: 20px;
    }

    /* Ensure totals stay right-aligned on mobile */
    .gh-totals {
        text-align: right;
        align-items: flex-end;
    }

    /* Hide specific columns in the admin table */
    .column-hide-mobile {
        display: none !important;
    }

    /* Prevent Admin Table buttons from becoming huge */
    .wp-list-table .button.button-small {
        width: auto !important;
        display: inline-block !important;
        padding: 0 8px !important;
        margin: 2px 0 !important;
        font-size: 11px !important;
        line-height: 2.2 !important;
        min-height: 24px !important;
    }

    .widefat td {
    font-size: 12px;
    }

    .ticket-sorting input[type="text"] {
        min-height: 30px;
    }

    .ticket-sorting .button {
        min-height: 30px;
        line-height: 28px;
        margin-bottom: 0px;
        padding: 0px 7px 0px 7px !important;
    }
}


/* MOBILE RESPONSIVENESS SMALL */
@media screen and (max-width: 525px) {

    /* Hide specific columns in the admin table */
    .column-hide-mobile-small {
        display: none !important;
    }

    input[type="text"].search-button {
        width: 180px;
    }

}




/* --- Admin Edit Specific Styles --- */
.gh-admin-form {
    background: #fff;
    padding: 25px;
    border: 1px solid #dddcdc;
}

.gh-admin-header {
    color: #4472c4;
    padding-bottom: 10px;
    margin: 30px 0 20px 0;
}

.gh-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Item Block Styling */
.gh-admin-item-block {
    display: flex;
    gap: 15px;
    background: #f9f9f9;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #99cc33;
    align-items: flex-start;
}

.gh-admin-item-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-grow: 1;
}

.gh-admin-item-grid div { display: flex; flex-direction: column; }
.gh-admin-item-grid label { font-size: 11px; font-weight: bold; margin-bottom: 3px; }

/* Desktop Widths for Edit Row */
.col-qty { width: 70px; }
.col-duration { width: 100px; }
.col-desc { flex-grow: 1; min-width: 200px; }
.col-date { width: 135px; }
.col-amt { width: 110px; }

.gh-admin-remove {
    background: #ff4444;
    color: #fff;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.gh-admin-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    font-size: 15px;
}

/* 1. Remove padding from inputs on the edit/view page */
.gh-admin-form input,
.gh-admin-form select {
    padding: 0px !important;
    text-indent: 5px; /* Adds a tiny bit of space for text without real padding */
    font-size: 15px;
}

.gh-admin-form textarea {
    padding: 5px !important;
    font-size: 15px;
    min-height: 180px;
}

.totals-box p {
    font-size: 15px;
}

h2.gh-admin-header {
    font-size: 24px;
    font-weight: bold;
}

/* 2. New 3-Column Grid for Admin Items */
.gh-admin-item-grid-3 {
    display: grid;
    grid-template-columns: 100px 1fr 200px; /* Matches frontend: small, auto, medium */
    gap: 20px;
    flex-grow: 1;
}

.gh-admin-item-grid-3 label {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 2px;
    display: block;
}

/* --- Global Font Correction --- */
.gh-admin-totals p, 
.gh-admin-totals h2,
.gh-admin-totals span,
.gh-totals div,
.gh-totals input {
    font-family: inherit; /* Ensures it matches your inputs */
    font-size: 15px !important;
}

/* --- Admin Edit Specific Layout --- */
.gh-admin-item-grid-3 {
    display: grid;
    grid-template-columns: 100px 1fr 220px; /* Qty/Dur | Desc | Dates/Amt */
    gap: 20px;
    flex-grow: 1;
}

/* Vertical Spacing within Columns */
.col-qty-duration, .col-dates-amt {
    display: flex;
    flex-direction: column;
}

.col-description {
    display: flex;
    flex-direction: column;
}

.tax-inputs {
    padding-top: 6px;
}

/* --- Responsive Admin Edit --- */
@media screen and (max-width: 768px) {
    .gh-admin-grid { grid-template-columns: 1fr; } /* Stack Customer Info */

    .gh-admin-item-block { flex-direction: column; }
    
    .gh-admin-item-grid > div {
        width: 100% !important; /* Stack all item inputs */
    }

    .gh-admin-footer { flex-direction: column; gap: 20px; }
    .gh-admin-footer .totals-box { text-align: right; }

    .gh-admin-item-grid-3 {
        grid-template-columns: 1fr !important; /* Stack columns on mobile */
        gap: 15px;
        width: 100%;
    }
    
    .gh-admin-item-block {
        flex-direction: column;
    }

    .gh-admin-remove {
        align-self: flex-end;
        margin-top: -10px;
    }

    .gh-admin-grid {
    gap: 0px;
}
}