/* ------------------------------
   Form Styles
-------------------------------*/
.upm-form {
    max-width: 700px;
    margin: 0;
    padding: 0;
    font-family: sans-serif;
}

.upm-form table {
    border-collapse: collapse;
    width: 100%;
}

.upm-form td {
    padding: 6px 10px;
    vertical-align: middle;
}

.upm-form label {
    display: block;
    text-align: right;
    font-weight: bold;
    margin-right: 10px;
    width: 150px;
}

.upm-form input[type="text"],
.upm-form input[type="email"],
.upm-form select {
    width: 300px;
    max-width: 100%;
    padding: 6px 8px;
    box-sizing: border-box;
}

.upm-form hr {
    margin: 20px 0;
    border: 1px solid #ccc;
}

/* ------------------------------
   Admin List Table Styles
-------------------------------*/
.udc-list-container {
    overflow-x: auto;
    margin-top: 20px;
}

.udc-list-container table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1100px;
}

.udc-list-container th,
.udc-list-container td {
    border: 1px solid #ccc;
    padding: 6px 10px;
    text-align: left;
    vertical-align: middle;
}

.udc-list-container th {
    background-color: #f4f4f4;
}

.udc-list-container tr:nth-child(even) {
    background-color: #fafafa;
}

/* Email wrap at @ */
.udc-list-container td.email {
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Responsive table for smaller screens */
@media (max-width: 768px) {
    .udc-list-container table,
    .udc-list-container thead,
    .udc-list-container tbody,
    .udc-list-container th,
    .udc-list-container td,
    .udc-list-container tr {
        display: block;
    }

    .udc-list-container tr {
        margin-bottom: 10px;
    }

    .udc-list-container td {
        text-align: right;
        padding-left: 50%;
        position: relative;
    }

    .udc-list-container td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: calc(50% - 20px);
        font-weight: bold;
        text-align: left;
    }
}

/* Existing list container */
.udc-list-container {
    max-width: 100%;
    overflow-x: auto;
}

/* Control table width */
.upm-list-table {
#    width: 100%;
#    table-layout: fixed;
     width: max-content;
     min-width: 100%;
     border-collapse: collapse;
}

/* Prevent cells forcing width */
.upm-list-table th,
.upm-list-table td {
    vertical-align: top;
    padding: 6px 8px;
}

/* Wrap long email addresses */
.upm-list-table td.email,
.upm-list-table td.emergency-email {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Keep action links usable */
.upm-list-table td.actions {
    white-space: nowrap;
}

.upm-list-table th,
.upm-list-table td {
    padding: 6px 8px;
    vertical-align: top;
    white-space: nowrap;
}

/* Allow wrapping for long text only */
.upm-list-table td.email,
.upm-list-table td.emergency-email {
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

/* Show header by default (desktop) */
body.upm-user-list-page header,
body.upm-user-list-page .site-header {
    display: block !important;
}

/* Portrait on mobile: show header */
@media screen and (max-width: 768px) and (orientation: portrait) {
    body.upm-user-list-page header,
    body.upm-user-list-page .site-header {
        display: block !important;
    }
}

/* Landscape on mobile: hide header */
@media screen and (max-width: 768px) and (orientation: landscape) {
    body.upm-user-list-page header,
    body.upm-user-list-page .site-header {
        display: none !important;
    }
}

.upm-rotate-hint {
    display: none;
    text-align: center;
    padding: 1em;
    background: #fff8c5;
    border: 1px solid #f0e68c;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 1em;
    color: #333;
}

/* Show only portrait on small screens */
@media screen and (max-width: 768px) and (orientation: portrait) {
    .upm-rotate-hint {
        display: block;
    }
}

/* Search bar */
.upm-user-search {
    margin-bottom: 1em;
    text-align: right;
}

#upm-user-search {
    padding: 0.4em 0.6em;
    border-radius: 4px;
    border: 1px solid #ccc;
    width: 100%;
    max-width: 250px;
}

