/* Migrated from components.css: legacy table compatibility.
   Keep this before the modern standard-table rules below so newer rules win. */
.table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid rgba(183,170,114,.12);
    background: rgba(255,255,255,.012);
}

.table-wrap table,
.food-manager-table,
.standard-data-table,
.tight-nutrition-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.table-wrap table thead th,
.food-manager-table thead th,
.standard-data-table thead th,
.tight-nutrition-table thead th {
    padding: 8px 10px 7px;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    background: rgba(255,255,255,.02);
    border-bottom: 1px solid rgba(183,170,114,.14);
}

.table-wrap table tbody tr,
.food-manager-table tbody tr,
.standard-data-table tbody tr,
.tight-nutrition-table tbody tr {
    border-bottom: 1px solid rgba(183,170,114,.14);
}

.table-wrap table tbody tr:last-child,
.food-manager-table tbody tr:last-child,
.standard-data-table tbody tr:last-child,
.tight-nutrition-table tbody tr:last-child {
    border-bottom: 0;
}

.table-wrap table td,
.food-manager-table td,
.standard-data-table td,
.tight-nutrition-table td {
    padding: 8px 10px;
    vertical-align: top;
    font-size: 12px;
    line-height: 1.35;
}

.management-table .table-name-header,
.management-table .table-name-cell {
    text-align: left;
}

.management-table .table-name-cell {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.management-table .table-status-header,
.management-table .table-status-cell {
    width: 7.4rem;
    text-align: center;
}

.management-table .table-action-header,
.management-table .table-action-cell {
    width: 9.5rem;
    text-align: right;
}

.table-action-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.table-action-form,
.action-cell .inline-form {
    margin: 0;
    display: block;
    width: 100%;
}

.table-action-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1.1rem;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 0;
    background: none;
    color: var(--text);
    text-align: right;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 0;
}

.table-action-link:hover,
.table-action-link:focus-visible {
    background: rgba(183,170,114,.10);
    outline: none;
}

.table-action-label {
    display: block;
    min-width: 0;
}

.table-action-icon {
    display: grid;
    place-items: center;
    color: var(--accent);
    font-size: 13px;
}

.table-name-cell .muted-line {
    display: block;
    margin-top: 2px;
}

.table-search-hint {
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
}

.tight-nutrition-table th:nth-child(2),
.tight-nutrition-table th:nth-child(3),
.tight-nutrition-table td:nth-child(2),
.tight-nutrition-table td:nth-child(3) {
    text-align: center;
}

@media (max-width: 980px) {
    .management-table .table-status-header,
    .management-table .table-status-cell {
        width: 6.5rem;
    }

    .management-table .table-action-header,
    .management-table .table-action-cell {
        width: 8.75rem;
    }
}

@media (max-width: 860px) {
    .management-table .table-status-header,
    .management-table .table-status-cell {
        width: 6rem;
    }

    .management-table .table-action-header,
    .management-table .table-action-cell {
        width: 8.1rem;
    }

    .table-action-link {
        font-size: 10px;
        letter-spacing: .04em;
    }
}


.standard-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.standard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

.standard-table th,
.standard-table td {
    padding: 13px 14px;
    border-bottom: 1px solid rgba(183,170,114,.09);
    vertical-align: middle;
    text-align: left;
}

.standard-table th {
    color: rgba(212,208,191,.74);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .01em;
    text-transform: none;
    background: rgba(0,0,0,.10);
    white-space: nowrap;
}

.standard-table td {
    color: #d9d6c8;
    font-size: 14px;
}

.standard-table tbody tr:hover {
    background: rgba(183,170,114,.045);
}

.standard-table .number-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.standard-table .center-cell {
    text-align: center;
}

.standard-row-title {
    display: grid;
    gap: 3px;
}

.standard-row-title strong {
    color: #e6e1d0;
    font-weight: 700;
}

.standard-row-title span {
    color: var(--muted);
    font-size: 12px;
}

.standard-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.standard-row-actions form {
    margin: 0;
}

.standard-favorite-btn {
    min-width: 34px;
    width: 34px;
    min-height: 34px;
    padding: 0;
    color: #d8c45c;
}

.standard-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.standard-pager a,
.standard-pager span {
    min-width: 36px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(183,170,114,.14);
    background: rgba(255,255,255,.02);
    color: #d9d4c5;
}

.standard-pager .is-active {
    background: rgba(183,170,114,.18);
    border-color: rgba(209,193,137,.34);
}

/* V3 second-pass: compact screenshot-style data tables. */
.standard-table-wrap {
    background: rgba(0,0,0,.075);
}

.standard-table {
    min-width: 980px;
}

.standard-table th,
.standard-table td {
    padding: 10px 12px;
    border-bottom-color: rgba(207,197,151,.075);
}

.standard-table th {
    height: 38px;
    color: rgba(216,211,193,.68);
    font-size: 11px;
    font-weight: 700;
    background: rgba(0,0,0,.18);
}

.standard-table td {
    height: 54px;
    color: rgba(224,220,205,.88);
    font-size: 13px;
}

.standard-table tbody tr {
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.standard-table tbody tr:hover {
    background: rgba(129,139,78,.055);
    box-shadow: inset 3px 0 0 rgba(169,161,95,.55);
}

.standard-row-title {
    gap: 3px;
}

.standard-row-title strong {
    color: #e9e3cf;
    font-size: 13px;
    font-weight: 650;
}

.standard-row-title span {
    color: rgba(204,199,178,.62);
    font-size: 11px;
}

.standard-favorite-btn {
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    color: #d6bf54;
    font-size: 15px;
}

.standard-row-actions {
    justify-content: flex-end;
}

.standard-row-action-btn {
    min-width: 64px;
}

.standard-pager {
    gap: 6px;
}

.standard-pager a,
.standard-pager span {
    min-width: 34px;
    min-height: 32px;
    background: rgba(255,255,255,.018);
    border-color: rgba(207,197,151,.12);
    color: rgba(224,220,205,.82);
    font-size: 12px;
}

.standard-pager .is-active {
    background: rgba(129,139,78,.28);
    border-color: rgba(207,197,151,.31);
    color: #f1ead3;
}

/* V3 third-pass: sortable table headers. */
.standard-table th[data-sort] {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 24px;
}

.standard-table th[data-sort="none"] {
    cursor: default;
    padding-right: 12px;
}

.standard-table th[data-sort]:not([data-sort="none"])::after {
    content: "↕";
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(204,199,178,.36);
    font-size: 10px;
}

.standard-table th[aria-sort="ascending"]::after {
    content: "↑";
    color: #d0c287;
}

.standard-table th[aria-sort="descending"]::after {
    content: "↓";
    color: #d0c287;
}

/* V3 fifth-pass: borderless favorite stars with clearer outline/fill states. */
.standard-table .standard-favorite-btn {
    width: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #d6bf54;
    font-size: 21px;
    line-height: 1;
}

.standard-table .standard-favorite-btn:hover,
.standard-table .standard-favorite-btn:focus-visible {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #f0d76a;
    transform: translateY(-1px);
}

.standard-favorite-symbol,
.standard-favorite-static {
    display: inline-block;
    min-width: 22px;
    color: #d6bf54;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

.standard-favorite-btn.is-not-favorite .standard-favorite-symbol,
.standard-favorite-static.is-not-favorite {
    color: rgba(218, 203, 128, .92);
    text-shadow: 0 0 0 rgba(218, 203, 128, .92);
}

.standard-favorite-btn.is-favorite .standard-favorite-symbol,
.standard-favorite-static.is-favorite {
    color: #f1d55f;
    text-shadow: 0 0 10px rgba(214,191,84,.18);
}

/* V3 sixth-pass: Font Awesome favorite state. */
.standard-favorite-symbol i,
.standard-favorite-static i {
    display: inline-block;
    line-height: 1;
}

.standard-favorite-btn.is-not-favorite .standard-favorite-symbol,
.standard-favorite-static.is-not-favorite {
    color: rgba(218,203,128,.86);
    opacity: .95;
}

.standard-favorite-btn.is-not-favorite .fa-regular,
.standard-favorite-static.is-not-favorite .fa-regular {
    font-weight: 400;
}

.standard-favorite-btn.is-favorite .fa-solid,
.standard-favorite-static.is-favorite .fa-solid {
    color: #f1d55f;
}

/* V3 seventh-pass: Font Awesome table icons and compact nutrition tables. */
.standard-table .fa-star {
    font-size: 12px;
}

.standard-table .standard-favorite-btn,
.standard-table .standard-favorite-static,
.standard-table .standard-favorite-symbol {
    color: #c83636;
}

.standard-table .standard-favorite-btn.is-not-favorite,
.standard-table .standard-favorite-static.is-not-favorite,
.standard-table .standard-favorite-btn.is-not-favorite .standard-favorite-symbol {
    color: rgba(216, 211, 193, .74);
}

.standard-table .standard-favorite-btn.is-not-favorite:hover,
.standard-table .standard-favorite-btn.is-not-favorite:focus-visible {
    color: rgba(239, 215, 106, .92);
}

.tight-nutrition-table th,
.tight-nutrition-table td {
    height: auto;
    padding-top: 6px;
    padding-bottom: 6px;
}

.tight-nutrition-table td {
    font-size: 12px;
}

/* V3 eighth-pass: keep Font Awesome stars compact in table cells. */
.standard-table .fa-star,
.standard-table .standard-favorite-symbol .fa-star,
.standard-table .standard-favorite-static .fa-star {
    font-size: 12px;
}

/* V3 ninth-pass: smaller Font Awesome table stars and nutrition warnings. */
.standard-table .fa-star {
    font-size: 12px;
}

.nutrition-warning-icon {
    display: inline-grid;
    place-items: center;
    margin-left: 6px;
    color: #f0d76a;
    vertical-align: middle;
}

.nutrition-warning-icon i {
    font-size: 12px;
}

.standard-table tbody tr.has-nutrition-warning {
    box-shadow: inset 3px 0 0 rgba(240, 215, 106, .72);
}

.standard-table tbody tr.has-nutrition-warning:hover {
    box-shadow: inset 3px 0 0 rgba(240, 215, 106, .95);
}

/* V3 fifteenth-pass: compact drawer nutrition tables must not inherit the wide module-table minimum. */
.standard-drawer .standard-table.tight-nutrition-table,
.standard-drawer .ingredient-view-nutrition-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}

.standard-drawer .ingredient-view-nutrition-table th:first-child,
.standard-drawer .ingredient-view-nutrition-table td:first-child {
    width: 48%;
}

.standard-drawer .ingredient-view-nutrition-table th:last-child,
.standard-drawer .ingredient-view-nutrition-table td:last-child {
    width: 52%;
    text-align: left;
    overflow-wrap: anywhere;
}


/* V3 sixteenth-pass: force compact drawer-only nutrition tables to stay inside the drawer. */
.standard-drawer .ingredient-view-nutrition-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.standard-drawer table.standard-table.ingredient-view-nutrition-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

.standard-drawer .ingredient-view-nutrition-table .ingredient-view-nutrient-col {
    width: 50%;
}

.standard-drawer .ingredient-view-nutrition-table .ingredient-view-value-col {
    width: 50%;
}

.standard-drawer .ingredient-view-nutrition-table th,
.standard-drawer .ingredient-view-nutrition-table td {
    height: auto;
    min-width: 0;
    padding: 7px 10px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.standard-drawer .ingredient-view-nutrition-table th:first-child,
.standard-drawer .ingredient-view-nutrition-table td:first-child,
.standard-drawer .ingredient-view-nutrition-table th:last-child,
.standard-drawer .ingredient-view-nutrition-table td:last-child {
    width: auto;
}


/* Meal library incomplete-row warning state. */
.standard-table tbody tr.meal-missing-info-row {
    background: rgba(214, 191, 84, .09);
    box-shadow: inset 3px 0 0 rgba(214, 191, 84, .85);
}

.standard-table tbody tr.meal-missing-info-row:hover {
    background: rgba(214, 191, 84, .14);
}

.meal-missing-warning {
    display: inline-grid;
    place-items: center;
    width: 1.35em;
    height: 1.35em;
    margin-right: .35rem;
    color: #f0d76a;
    vertical-align: -0.12em;
}

.meal-missing-reasons {
    color: #f0d76a !important;
    font-size: 11px;
    letter-spacing: .02em;
    text-transform: uppercase;
}
