.xcrud {
    margin-bottom: 20px;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #1f2937;
}

/* jQuery UI's own minWidth dialog option is a no-op when width is 'auto'
   (set in ui_modal() in xcrud.js) - a short 2-3 field form otherwise opens
   noticeably narrower than feels proportionate next to the full-width grid
   behind it. Enforce it here instead. */
.ui-dialog {
    min-width: 50vw;
    box-sizing: border-box;
}

/* Tailwind ships no default table chrome - these give the grid borders,
   header background, zebra striping and row hover that the other themes get
   for free from their CSS framework's table.table-striped/table-bordered. */
.xcrud-list {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.xcrud-list th,
.xcrud-list td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.xcrud-list thead th {
    background: #f9fafb;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.xcrud-list tbody tr:nth-child(even) {
    background: #fafafa;
}

.xcrud-list tbody tr:hover {
    background: #f3f4f6;
}

.xcrud-column:hover {
    text-decoration: underline;
    cursor: pointer;
}

.xcrud-top-actions {
    padding: 5px 0;
}

.xcrud-container {
    position: relative;
}

.xcrud-list-container {
    clear: both;
    padding: 0 !important;
}

.xcrud-nav {
    padding: 12px 4px 4px;
}

.xcrud-nav > * {
    vertical-align: top;
}

td.xcrud-actions {
    text-align: right;
    white-space: nowrap;
}

.xcrud-actions a {
    vertical-align: top;
}

.xcrud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: #fff 50% 50% no-repeat url(loading.gif);
    opacity: 0.5;
    width: 100%;
}

.xcrud-num {
    color: #bbb;
    width: 10px;
}

.xcrud-benchmark {
    margin: 5px;
    font-size: 10px;
    line-height: 1.2;
    float: right;
    color: #999;
}

.xcrud-benchmark span {
    margin: 0 5px;
}

/* jQuery UI Tabs injects display:none/block on .tab-pane itself; this just
   frames the visible pane to match the tab strip above it. */
.xcrud .tab-content {
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-top: 0;
    border-radius: 0 0 6px 6px;
}

.xcrud .xcrud-file-container.error {
    border: 1px solid #dc2626;
    background-color: #fee2e2;
    padding-left: 5px;
}

.xcrud .xcrud-file-container {
    font-size: 14px;
    line-height: 30px;
}

.xcrud .xcrud-file-container img {
    max-width: 99%;
    vertical-align: bottom;
}

.xcrud-add-file {
    position: relative;
    overflow: hidden;
}

input.xcrud-upload {
    cursor: pointer;
    direction: ltr;
    font-size: 100%;
    margin: 0;
    opacity: 0;
    position: absolute;
    right: 0;
    top: 0;
    transform: translate(-300px, 0px) scale(4);
}

.xcrud .xcrud-list td.xcrud-sum {
    font-weight: bold;
}

.xcrud-list td.align-left {
    text-align: left;
}

.xcrud-list td.align-right {
    text-align: right;
}

.xcrud-list td.align-center {
    text-align: center;
}

.xcrud-list td.font-bold {
    font-weight: bold;
}

.xcrud-list td.font-italic {
    font-style: italic;
}

.xcrud-list td.text-underline {
    text-decoration: underline;
}

.xcrud-th th {
    background: #f9fafb;
    white-space: nowrap;
}

.xcrud-search input,
.xcrud-search select {
    width: 10%;
    margin: 0 5px 0 0;
    vertical-align: top;
    min-width: 120px;
}

/* per-column instant filter row (see header_filters()) */
.xcrud-header-filters-row th,
.xcrud-header-filters-row td {
    padding: 4px 6px !important;
    background: #fafafa;
    border-top: 1px solid #e5e7eb;
}

.xcrud-header-filter-cell input.xcrud-header-filterdata,
.xcrud-header-filter-cell select.xcrud-header-filterdata {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

/* list tabs (see list_tab()) */
.xcrud-list-tab {
    background: none;
    border: 0;
}

/* pagination (see xcrud.ini pagination_* keys) */
.xcrud-tw-page-item {
    display: inline-flex;
}

.xcrud-tw-page-active .xcrud-action {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* address/point search dropdown */
ul.xcrud-map-dropdown {
    position: absolute;
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 220px;
    overflow-y: auto;
}

ul.xcrud-map-dropdown li {
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
}

ul.xcrud-map-dropdown li:hover {
    background: #f3f4f6;
}

.xcrud-map {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-top: 6px;
}

.xcrud-googlemap img {
    max-width: inherit;
}
