/* =============================================
   App Table — shared table styles
   Used by: guild-simulations, guild-sets, guild-boosts,
            guild-members, guild-rosters, calendar-event,
            simulation-roster-detail
   ============================================= */

.app-table-container {
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--bg-surface-2) 82%, #000 18%),
        color-mix(in srgb, #000 24%, var(--bg-surface-1))
    );
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    overflow: hidden;
}

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

.app-table thead {
    background: var(--bg-primary-faint);
}

.app-table th {
    padding: 0.80rem 1.25rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-primary-strong);
}

.app-table th.center {
    text-align: center;
}

.app-table th.right {
    text-align: right;
}

.app-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.app-table tbody tr {
    border-bottom: 1px solid var(--border-faint);
    transition: all 0.3s ease;
}

.app-table tbody tr:hover {
    background: var(--bg-primary-ghost);
}

.app-table tbody tr:last-child {
    border-bottom: none;
}

.app-table td {
    padding: 0.62rem 1.25rem;
    color: var(--text-primary);
}

.app-table td.center {
    text-align: center;
}

.app-table td.right {
    text-align: right;
}

.loot-table-grid:not([data-has-char-filter="1"]) .loot-table-char-only {
    display: none;
}

.loot-table-summary-row {
    background: color-mix(in srgb, var(--bg-primary-faint) 34%, transparent);
}

.loot-table-summary-row:hover {
    background: color-mix(in srgb, var(--bg-primary-faint) 40%, transparent);
}

.loot-table-summary-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.loot-table-summary-meta--right {
    justify-content: flex-end;
}

.loot-table-summary-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.loot-table-summary-input {
    max-width: 110px;
}

.loot-table-summary-probability-cell {
    text-align: right;
}

.loot-table-summary-value {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
}

.loot-table-check-label {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}

.loot-table-check-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}

.loot-table-check-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg-input) 84%, transparent);
    transition: all 0.18s ease;
}

.loot-table-check-mark {
    width: 0.95rem;
    height: 0.95rem;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    background: transparent;
    position: relative;
}

.loot-table-check-mark::after {
    content: "";
    position: absolute;
    left: 0.22rem;
    top: 0.04rem;
    width: 0.32rem;
    height: 0.6rem;
    border: solid var(--bg-surface-2);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.14s ease;
}

.loot-table-check-label:hover .loot-table-check-chip {
    border-color: var(--border-primary);
    background: color-mix(in srgb, var(--bg-input-hover) 78%, transparent);
}

.loot-table-check-input:checked + .loot-table-check-chip {
    border-color: var(--border-primary-strong);
    background: color-mix(in srgb, var(--bg-primary-faint) 72%, transparent);
}

.loot-table-check-input:checked + .loot-table-check-chip .loot-table-check-mark {
    border-color: var(--color-tab);
    background: var(--color-tab);
}

.loot-table-check-input:checked + .loot-table-check-chip .loot-table-check-mark::after {
    transform: rotate(45deg) scale(1);
}

.loot-table-check-input:focus-visible + .loot-table-check-chip {
    outline: 2px solid color-mix(in srgb, var(--color-primary) 45%, transparent);
    outline-offset: 2px;
}

.app-table tbody tr.current-user {
    background: var(--bg-primary-faint);
    border-left: 2px solid var(--color-primary);
}

.boss-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid var(--border-primary-strong);
    object-fit: cover;
    display: block;
    margin: 0 auto;
}
